Install the package with pip:
pip install mkdocs_quiz
Add the following to your mkdocs.yml
:
plugins:
- mkdocs_quiz
Now you can create your first quiz directly in markdown:
<?quiz?>
question: Are you ready?
answer-correct: Yes!
answer: No!
answer: Maybe!
content:
<h2>Provide some additional content</h2>
<?/quiz?>
Info The answers can get styled with HTML (like
<code>Yes!</code>
)
Warning The quiz content needs to be valid HTML
You can also create a multiple choice quiz, by providing multiple answers as correct.
<?quiz?>
question: Are you ready?
answer-correct: Yes!
answer: No!
answer-correct: Maybe!
content:
<h2>Provide some additional content</h2>
<?/quiz?>
The single choice quiz will get generated as a radio button group, while the multiple choice quiz will get generated as a checkbox group.
You can disable the quiz for a page by adding the following to the top (meta) of the page:
---
quiz: disable
---