Quarto Quizdown Example
A Quarto filter extension for writing short quizzes with a markdown-like syntax. It is based on the quizdown-js library and the hugo-quiz extension originally developed by bonartm:
Note that it’s a filter and not a shortcode as it was in hugo-quiz b/c Quarto doesn’t seem to export content between opening and closing shortcode tags like Hugo does. Maybe I’ll figure out a way to do that in the future, but for now, this is a filter that lets you write quizdown instances within quizdown code blocks indicated using {quizdown}
or quizdown
.
Try out the original live code editor for quizdown: https://bonartm.github.io/quizdown-live-editor/
Here’s the README from the Github Repo, in case you missed it:
Quizdown Extension For Quarto
This is a Quarto extension for creating short interactive quizzes in Quarto documents. This project ports the hugo-quiz extension, originally developed by bonartm, over to Quarto. It is based on the quizdown-js library.
Installing
quarto add parmsam/quarto-quizdown
This will install the extension under the _extensions
subdirectory. If you’re using version control, you will want to check in this directory.
Using
You can use the quizdown
extension in your Quarto documents by adding the following to the YAML header:
filters:
- quizdown
Then, you can create a quiz using the quizdown
codeblock:
```quizdown
# Python Lists (multiple choice)
What is the value of `x[2]`?
> Python lists are mutable!
~~~python
x = [2, 3, 4]
x[2] = 4
print(x[2])
~~~
- [ ] 1
- [ ] 2
- [ ] 3
- [x] 4
# What is the capital of Germany (single choice)?

> It's the largest city in Germany!
1. [ ] Frankfurt
1. [x] Berlin
1. [ ] Hamburg
1. [ ] Munich
# Put the [days](https://en.wikipedia.org/wiki/Day) in order (sequence)!
Quizdown also renders formulas:
$$
x = \frac{a+b^2}{\sqrt{b+c}}
$$
> Monday is the *first* day of the week.
1. Monday
2. Tuesday
3. Wednesday
4. Friday
5. Saturday
See the quizdown documentation for more information on how to use the quizdown library. The online editor is available at https://bonartm.github.io/quizdown-js/.
Example
Here is the source code for a minimal example: example.qmd.