Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Question ¶
type Question struct { Category string `json:"category"` Type string `json:"type"` Difficulty string `json:"difficulty"` CorrectAnswer string `json:"correct_answer"` Question string `json:"question"` Answers []string `json:"answers"` }
Question holds all the information for each question.
type Questions ¶
type Questions struct {
Questions QuestionsPacks `json:"questions"`
}
Questions hold all the pack of questions.
func NewQuestions ¶
func NewQuestions() *Questions
NewQuestions reads all the questions from a file, and generates data.
type QuestionsPacks ¶
type QuestionsPacks struct { Easy []Question `json:"easy"` Medium []Question `json:"medium"` Hard []Question `json:"hard"` }
QuestionsPacks holds the question packs depending the difficulty.
Click to show internal directories.
Click to hide internal directories.