quiz markdown block.
{
id: "uniqueID", // Card unique id, if empty create automatically, using question data;
question: {
left: ['Question', ...], // Left question options;
right: ['Answer', ...] // Right question options;
},
pool: "pool", // Card pool;
tags: ["tag1", "tag2", ...], // Array of tags;
defaultSide: "left", // If card not reversible, then that side will be considered questions;
notReversible: true // If card reversible, then the questions and answers will switch places;
}
```quizjson
[
{
"question": {
"left": ["question1", "subQuestion1"],
"right": ["answer1", "answer2", "answer3"]
},
"pool": "testPool1",
"tags": ["exampleTag1", "exampleTag2", "exampleTag3"],
"notReversible": true
}
]
```
Must be enabled from settings.
In the code fc object is available with two methods:
addCard(flashcard); - Adds a card, if it is not valid performs an exception.commit(); - Must be called after all cards have been added.```quizjs
for(let i = 0; i < 100; i++) {
fc.addCard({
question: {
left: [`question${i}`],
right: [`answer${i}`]
},
pool: "testPool2",
tags: [`exampleTag${i}`]
});
}
fc.commit();
```
There are several ways to start a quiz:
Simple Quiz:Run quiz! menu command;quiz markdown block, who render inline quiz form;Depending on where the quiz was launched from, the set of cards will be different:
quiz markdown block, by default it will load all possible cards, but you can customize with sources argument;If saving results is enabled, the cards will be sorted by success, otherwise they will be randomly mixed.
Markdown blocks description
Groups description
Examples of usage
Copy over main.js, styles.css, manifest.json, to <vault>/.obsidian/plugins/simple-quiz/