Quan Nguyen150 downloadsInteractive single, multiple, matching, and ordering quizzes from YAML code blocks.
Quizcraft turns plain Obsidian callouts into interactive widgets. Notes stay ordinary Markdown: without the plugin they still read as a question followed by its answer, and the widgets never write to a note.
Coming from 0.1.x? The quizcraft YAML code block is gone. Each question is
now a [!quiz] callout; see Quiz cards. A command converts
your old blocks: see Upgrading from 0.1.x.
Community plugins
Manual
main.js, manifest.json and styles.css from the
latest release.<vault>/.obsidian/plugins/quizcraft/.BRAT
quannh-netalik/quizcraft.Quizcraft works on desktop and mobile and needs Obsidian 1.5 or later.
> [!quiz] Which HTTP status means "not found"?
> - A) 301
> - B) 404
> - C) 500
>
> ==Answer==
>
> B) 404
In Reading view or Live Preview this is a card with three options and a Submit Answer button. Without the plugin it reads as the question with its answer underneath.
Each widget is a callout. The callout type picks the widget; the callout
metadata ([!type|meta]) carries widget options.
| Callout | Widget |
|---|---|
[!quiz] |
Multiple-choice question graded on submit |
[!quiz|order] |
Put the steps in the right order |
[!quiz|match] |
Match each item on the left to one on the right |
[!code] |
Code editor with language tabs and file panes |
[!tabs] |
Content tabs |
[!carousel] |
Image slides, one at a time |
[!calc|formulas] |
Spreadsheet table with live formulas |
[!demo|height] |
HTML file run in a sandboxed frame |
Rules shared by every widget:
==Answer== marker line.A [!quiz] callout is a question card. A line holding only ==Answer==
starts the answer: everything after it moves into a collapsible
Show answer section at the bottom of the card.
> [!quiz] Question 1
> Which planet is closest to the Sun?
> - A) Venus
> - B) Mercury
> - C) Mars
>
> ==Answer==
>
> **B)** Mercury
> Mercury orbits at about 0.39 AU.
>
> **Why not the others**
> - Venus is second, Mars is fourth.
**B)** or **B.**) is a key line and
shows the letter as a badge. Write one key line per correct option.**Why not the others** starts a muted sub-section; the
list after it belongs to it.==Answer== line, or with nothing after it, the card has no
answer section.A card whose list has two or more lettered options (- A) text or
- A. text) becomes an interactive quiz:
Two or more key lines make the quiz multi-select (checkboxes). A question
with one right option can still ask for checkboxes by containing
*(Multi-select)*. A quiz with no key lines shows No answer key found
instead of grading.
[!quiz|order] lists the steps as bullets. The numbered list after
==Answer== is the right order:
> [!quiz|order] Make tea
> Put the steps in order.
> - Pour
> - Boil water
> - Steep
> - Add tea
>
> ==Answer==
>
> 1. Boil water
> 2. Add tea
> 3. Steep
> 4. Pour
[!quiz|match] has two bullet lists: the items on the left, then the choices.
A bold paragraph above each list labels the column. The answer pairs each
left item with its choice, in bold, in the order of the left list:
> [!quiz|match] Ports
> Match each protocol to its default port.
>
> **Protocol**
> - HTTP
> - HTTPS
> - SSH
>
> **Port**
> - 22
> - 80
> - 443
>
> ==Answer==
>
> - HTTP → **80**
> - HTTPS → **443**
> - TLS on top of HTTP
> - SSH → **22**
[!code] draws a dark code editor. Each [!tab] inside it is one language;
each tab holds one code block, or [!file] callouts when the example has
several files:
> [!code] Reading a file
>> [!tab] Go
>> ```go
>> data, err := os.ReadFile("notes.txt")
>> ```
>
>> [!tab] Python
>>> [!file] main.py
>>> ```python
>>> from util import read
>>> ```
>>
>>> [!file] util.py
>>> ```python
>>> def read(path): ...
>>> ```
[!file] callouts straight under [!code].> [!code] with no caption hides the default "Code" title.
[!tabs] makes plain content tabs. Each [!tab] is one tab and holds any
Markdown. [!tab|leaf] shows the Lucide icon leaf
before the name. Each [!tabs] box keeps its own selection.
> [!tabs] Install
>> [!tab|apple] macOS
>> `brew install bun`
>
>> [!tab|terminal] Linux
>> `curl -fsSL https://bun.sh/install | bash`
[!carousel] with two or more image embeds shows them as slides, one at a
time:
> [!carousel]
> ![[request-1.png|Client sends the request]]
> ![[request-2.png|Server checks the token]]
> ![[request-3.png]]
| is the caption. An embed without one has no caption.
[!calc] turns a table into a small spreadsheet. Formulas go in the callout
metadata, ; between them:
> [!calc|B3=B1+B2;B4=round(B3/4,1)] Monthly budget
> | | |
> |---|---|
> | Rent | ==1,000== |
> | Food | ==400== |
> | Total | 1400 |
> | Per week | 350 |
A1. The header row is not
part of it.==value== cells become inputs. Every edit recomputes the formula cells.
Formula language:
| Syntax | Meaning |
|---|---|
12, 1.5 |
numbers |
B2 |
the value of a cell; text that is not a number counts as 0 |
+ - * / |
arithmetic, usual precedence |
^ |
power, right-associative: 2^3^2 is 2^9 |
( ) |
grouping |
round(x), round(x, digits) |
round; negative digits round to tens, hundreds, … |
ceil(x, digits), floor(x, digits) |
round up or down, digits as for round |
A formula outside this language keeps the value the note shows. A result that
is not a number, such as division by zero, shows —. Formulas that refer to
each other in a loop stop at the value written in the note.
[!demo] runs an HTML file from the vault in a frame under the text:
> [!demo|320] A ticking clock
> [[clock.html]]
| is the frame height in pixels; the default is 400..html file in the vault, the callout
stays a plain link, so the note still shows what is missing.
Version 1.0 dropped the quizcraft YAML code block; an old block now shows as
plain code. Two commands rewrite old blocks as [!quiz] callouts:
Back up the vault first if it is not under version control. Each question becomes one callout:
0.1.x type |
Becomes |
|---|---|
single |
[!quiz] with lettered options and one key line |
multiple |
[!quiz] with one key line per answer; one answer adds *(Multi-select)* |
ordering |
[!quiz|order], steps listed in reverse, numbered key in order |
matching |
[!quiz|match] with Item and Match columns, choices sorted A–Z |
A one-question block takes the block's title as its callout title. A block
with several questions keeps the title as a bold line above Question 1,
Question 2, and so on. The explanation follows the key in the answer
section.
A block the commands cannot read, such as invalid YAML or an answer number past the last option, stays as it was. The notice names the note and the reason, and the full list goes to the developer console.
Settings → Quizcraft has two toggles. A change applies to notes rendered after it; reopen a note to see it.
| Setting | Default | Effect |
|---|---|---|
| Shuffle quiz options | on | Deal multiple-choice options in random order. Off keeps the markdown order. Order and match quizzes always shuffle, because their order is the question. |
| Remember code language | on | Open code editors on the language picked last, in every note and after a restart. Off opens each editor on its first tab; picking a tab still switches the other open editors. |
Requires Bun 1.4 or later.
bun install
bun run dev # unminified build to main.js
bun run check # typecheck, lint, test
bun run build # production build
bun run bump 0.3.0 # set version in package.json, manifest.json, versions.json
src/main.ts plugin entry: settings, setting tab, commands, one markdown post-processor
src/settings/ QuizcraftSettings, DEFAULT_SETTINGS and the setting tab
src/migrate/ commands that convert 0.1.x YAML blocks to callouts
src/widgets/registry.ts Widget interface and the ordered widget list
src/widgets/quiz/ [!quiz] card, answer section, choice, order and match grading, shared footer
src/widgets/code/ [!code] editor, [!file] panes, [!tabs] and the shared tab bar
src/widgets/carousel/ [!carousel] image slides
src/widgets/calc/ [!calc] formula parser and spreadsheet
src/widgets/demo/ [!demo] sandboxed HTML frame
src/lib/ DOM helpers and shuffle, shared by widgets
styles/ one stylesheet per widget; build.ts joins them into styles.css
tests/stubs/ obsidian API stand-ins and DOM helpers for happy-dom
tests/helpers/ callout fixtures
tests/<area>/ tests, one folder per src area
scripts/ release tooling
A new widget gets its own folder under src/widgets/, exports a Widget,
and is added to WIDGETS in the registry. The layout follows what most
large community plugins do (Dataview, Templater, Tasks, obsidian-git): a thin
entry file, one folder per feature, stubs kept beside the tests.
Link the repo into a test vault so each build is picked up on reload:
ln -s "$PWD" /path/to/vault/.obsidian/plugins/quizcraft
bun run dev
Then enable Quizcraft under Settings → Community plugins and run Reload app without saving after each build. Check both Reading view and Live Preview: Live Preview re-renders callouts while you type.
MIT