Danijela Popović
Danijela Popović

Reputation: 122

How to implement creation of simple quizzes in python-markdown?

I recently found tech.io's playgrounds. I'm absolutely amazed with their quiz Markdown extension. I have a blog created with Pelican, and this type of quizzes would be a perfect addition.

For those unfamiliar with tech.io's quiz syntax...

?[How do you say 1 in spanish?]
-[ ] eins
-[x] uno
-[ ] unu

What type of processor should I use? Any suggestion about how should it look like?

Upvotes: 1

Views: 309

Answers (1)

Gabriel Braico Dornas
Gabriel Braico Dornas

Reputation: 665

For all searching the web interested in this kind of question, I found the mkdocs-quiz plugin that add quizzes to the python mkdocs static site generator.

Here you have a really nice implementation of the plugin. The content of the page is in Portuguese, but I think it's enough to grasp the plugin's potential.

Here, the GitHub repo for this project.

It basically:

<?quiz?>
question: Are you ready?
answer-correct: Yes!
answer: No!
answer: Maybe!
content:
<h2>Provide some additional content</h2>
<?/quiz?>

The project also better formatted the quiz structure, if you're interested in taking yours to the next level.

As a second option, I've also found the mkdocs_quiz_plugin lib, but haven't tried it yet.

Enjoy!

[^1]: the project uses poetry, but you could simply pip install mkdocs_quiz or add mkdocs_quiz to your requirements.txt file if you're using venv.

Upvotes: 0

Related Questions