YAQA uses JSON format for generating quizzes. Each question is stored as a JSON object in an array. To add, delete, or modify quiz questions, you just need to edit the JSON source.
[
{
"type": "true/false",
"difficulty": "hard",
"question": "Is 1 = 1?",
"answer": true
},
{
"type": "multiple-choice",
"difficulty": "expert",
"question": "The answer is A",
"choices": ["Answer A","Answer B","Answer C","Answer D"],
"answer": "Answer A"
}
]Entire example quiz is available here.
| Field | Data Type | Required | Options | Description |
|---|---|---|---|---|
type |
string | Yes | "flashcard", "one-line", "true/false", "multiple-choice" |
Defines the type of question. |
difficulty |
string | Yes | - easy, medium, hard, expert |
Represents the difficulty level of the question. |
question |
string | Yes | "How much is 2+2?" |
Defines the question text. |
choices |
array | Only for multiple-choice type |
["Choice A", "Choice B" ... ] |
Optional property for multiple-choice questions, containing the answer options. |
answer |
string or boolean | Yes | "The capital of France is Paris" |
Defines the correct answer to the question. For true/false questions, it's a boolean value (true or false). |
{
"type": "flashcard",
"difficulty": "expert",
"question": "What is the capital of Australia?",
"answer": "No it's not Sydney. It is Canberra"
}{
"type": "one-line",
"difficulty": "medium",
"question": "How is called our galaxy?",
"answer": "Milky Way"
}{
"type": "true/false",
"difficulty": "easy",
"question": "Is 1 = 1?",
"answer": true
}{
"type": "multiple-choice",
"difficulty": "hard",
"question": "Who invented Git?",
"choices": ["Elon Musk","Richard Stallman","Linus Torvalds","Microsoft"],
"answer": "Linus Torvalds"
}- Ensure that the
typefield is one of the specified options. - The
difficultyfield should be one ofeasy,medium,hard, orexpert. But it can also contain other value if you want. - The
questionfield must be a non-empty string. - For
multiple-choicequestions, the choices field must be an array of strings with at least two options. - The
answerfield must match the type of question (boolean fortrue/falsequestion andstringfor other ones). - Overall quiz json must be properly formatted to avoid any errors.