Skip to content

QuizMD: Format Specification v0.3

Part of the LearnSpec suite. Draft based on v0.2.

Core principle: YAML everywhere

QuizMD uses YAML as its single configuration syntax, applied across three progressive and backward-compatible levels. Keys are the same at every level, one mental model to learn.

LevelMechanismPurpose
0Plain .quiz.md, no configurationMinimal quiz, human-readable
1YAML frontmatter at top of fileGlobal metadata, behaviour, scoring
2Per-question ```quiz fenced blockPer-question overrides (points, timer, hint)

A Level 0 file is valid at Level 1 and 2. Each level is a strict superset of the previous one.

PrincipleDescription
Markdown-firstA .quiz.md file is valid Markdown readable in any editor
File-nativeAll content lives in files, no database required
YAML everywhereOne configuration syntax across all three levels
AI-nativeGeneratable and consumable by LLMs without specific tooling
LearnSpec-interoperableNatively integrates with LearnMD, DiagramMD, MediaMD, and GlossaryMD

QuizMD inherits its frontmatter, directives, and validation rules from the shared Architecture Charter.

Level 0: Base Markdown syntax

Conventions

SyntaxMeaning
## Qn or ## Qn · TitleStart of a question
- [x]Correct answer choice
- [ ]Incorrect answer choice
___Open-answer field (short answer / fill-in-the-blank)
---Question separator (optional when ## is used)
> textFeedback / explanation (shown after submission)
!import ./file.quiz.mdInclude questions from a sub-quiz file
!ref ./file.diagram.mdDeclare a DiagramMD context (enables ```diagram ref:slug resolution)
!ref ./file.media.mdDeclare a MediaMD context (enables media:slug resolution)
!ref ./file.glossary.mdDeclare a GlossaryMD context (enables term highlighting)
```diagram ref:slugRender a named diagram from a !ref-ed DiagramMD file
$...$Inline LaTeX math formula
$$...$$Block (display) LaTeX math formula
![alt](media:slug "fallback-url")Image via MediaMD with fallback
![alt](url)Direct image

Question body

The body of a question is all Markdown content between the ## Qn heading (and its optional ```quiz block) and the first answer choice (- [ ] / - [x]) or the ___ marker. The body may contain paragraphs, lists, tables, formulas, images, and diagrams, any valid Markdown.

This mechanism supports passage-based questions (reading comprehension, physics problems, legal cases) without any additional syntax.

Minimal example

markdown
# My first quiz

## Q1 · What is the capital of France?

- [ ] London
- [x] Paris
- [ ] Berlin

> Paris has been the capital since the 10th century.

## Q2 · True or false: The Earth is flat.

- [ ] True
- [x] False

## Q3 · Fill in the blank: The sun is a ___.

**Answer:** star

Question types

MCQ: single correct answer

One - [x] marks the correct choice. All other choices use - [ ].

markdown
## Q1 · Which composer wrote "The Four Seasons"?

- [ ] Johann Sebastian Bach
- [ ] George Frideric Handel
- [x] Antonio Vivaldi
- [ ] Arcangelo Corelli

> "The Four Seasons" (1725) is a set of four violin concertos by Vivaldi.

Multi-select: multiple correct answers

Two or more - [x] marks indicate multiple correct choices. Players should display checkboxes rather than radio buttons.

markdown
## Q2 · Which are characteristics of Baroque music?

- [x] Basso continuo
- [x] Terraced dynamics
- [ ] Twelve-tone serialism
- [x] Elaborate ornamentation
- [x] Counterpoint and polyphony
- [ ] Minimalist texture

Open answer: fill in the blank

The ___ marker signals a free-text input field. The expected answer follows on an **Answer:** line.

markdown
## Q3 · Fill in the blank: Bach's 30 keyboard variations are known as the ___ Variations.

**Answer:** Goldberg

Multiple blanks in a single question are supported by repeating ___:

markdown
## Q4 · Complete: ___ was born in ___, Germany.

**Answer:** Handel | Halle

True / False

A True/False question is an MCQ with exactly two choices labelled True and False.

Match pairs

Associates items from two columns. Declared with type: match in the per-question block.

markdown
## Q5 · Match each composer with their nationality.

```quiz
type: match
points: 4
```

| Composer | Nationality |
|---|---|
| Bach | German |
| Vivaldi | Italian |
| Handel | German |
| Rameau | French |

Order

Asks the learner to sort items into the correct sequence. Declared with type: order. The correct order is the order in which items appear in the list.

markdown
## Q6 · Place these composers in chronological order of birth.

```quiz
type: order
points: 3
```

1. Claudio Monteverdi (1567)
2. Heinrich Schütz (1585)
3. Jean-Baptiste Lully (1632)
4. Henry Purcell (1659)
5. Antonio Vivaldi (1678)

Diagrams and media in questions

Diagrams

A question body may contain diagram blocks using DiagramMD Level 0 fenced block syntax with optional Level 2 attributes (caption, width, alt). The DiagramMD frontmatter (Level 1) is not applicable.

markdown
## Q7 · What type of circuit is shown below?

```tikz caption:"Circuit diagram" alt:"Series circuit with resistor and capacitor"
\begin{tikzpicture}
  \draw (0,0) to[R, l=$R$] (2,0) to[C, l=$C$] (4,0);
\end{tikzpicture}
```

- [x] Series RC circuit
- [ ] Parallel RL circuit
- [ ] Series LC circuit

For diagrams reused across multiple questions, gather them in a .diagram.md catalogue declared via !ref ./file.diagram.md and reference each one inline with:

markdown
```diagram ref:rc-circuit
```

Images via MediaMD

markdown
!ref ./media-biology.media.md

## Q9 · Which organelle is shown in the image?

![Plant cell diagram](media:plant-cell "https://upload.wikimedia.org/.../plant-cell.svg")

- [x] Chloroplast
- [ ] Mitochondrion
- [ ] Nucleus

Feedback syntax

QuizMD supports four levels of feedback, freely combinable within a single question:

SyntaxScopeWhen displayed
> text (indented under a choice)Per-choiceOnly when that choice is selected
> [!correct] textGlobalOnly when the answer is correct
> [!incorrect] textGlobalOnly when the answer is incorrect
> textGlobalAlways (general explanation)

Display priority

  1. Per-choice feedback is displayed inline, below the option, only if the learner selected it.
  2. [!correct] or [!incorrect] appears in the result banner according to the outcome.
  3. Global > feedback always appears in the result banner, after the targeted feedback.
  4. For open-answer questions, only global feedback applies.

The !import directive

Includes questions from another .quiz.md file.

markdown
!import ./sub-quiz.quiz.md
  • Questions from the sub-quiz are inserted at the position of the directive.
  • Questions are renumbered sequentially across the full assembled quiz.
  • The frontmatter of the sub-quiz is ignored.
  • Nested imports are not supported. !import directives are only honoured when they appear in the entry file of a quiz (or in the entry .learn.md of a course that embeds this quiz). An !import line inside a file that is itself imported is inert: renderers and authoring tools must ignore it. Authors must lift every !import to the entry file. Circular imports cannot occur because nesting is forbidden.
  • Missing files are ignored without error (warning in lenient mode).

To assemble many files into a multi-step learning path, use TrackMD: the suite's orchestrator format, the only one that imports content across types (.learn.md, .quiz.md, .flash.md), rather than chaining QuizMD imports.

DiagramMD files (.diagram.md) are not consumed via !import, they are leaf catalogues declared with !ref ./file.diagram.md and addressed by slug via ```diagram ref:slug blocks.

Reveal and feedback modes

reveal: question display

ValueBehaviour
all (default)All questions displayed at once
sequentialQuestions revealed one at a time

feedback_mode: when corrections appear

ValueBehaviour
immediate (default)Correction shown immediately after submission
deferredAnswers recorded without revealing corrections; results shown at the end

Typical combinations

revealfeedback_modeUse case
allimmediatePractice mode (default)
sequentialimmediateGuided progression
alldeferredPaper-style exam
sequentialdeferredExam mode

Level 1: YAML frontmatter

Field reference

FieldTypeRequiredDefaultDescription
titlestringNononeQuiz title, inferred from the first # H1 if absent
langBCP-47YesnoneLanguage code (en, fr, en-US…)
descriptionstringNononeShort description
authorstring or objectNononeAuthor name, or {name, email, url}
tagsstring[]No[]Thematic tags
kindenumNononerecreational, academic, corporate, certification
revealenumNoallall or sequential
feedback_modeenumNoimmediateimmediate or deferred
shuffle_questionsboolNofalseRandomise question order
shuffle_answersboolNotrueRandomise answer choice order
passing_scorefloatNononeMinimum ratio to pass (0.0–1.0)
time_limitintNononeTotal time limit in seconds
scoring.correctintNo1Points per correct answer
scoring.incorrectintNo0Points per incorrect answer
createddateNononeCreation date, ISO 8601
updateddateNononeLast update date, ISO 8601
licensestringNononeSPDX identifier or custom
spec_versionstringNononeTargeted spec version (e.g. "0.3")

Example

yaml
---
title: Physics, Geometric Optics
lang: en
kind: academic
passing_score: 0.6
reveal: sequential
feedback_mode: deferred
shuffle_answers: true
time_limit: 1800
scoring:
  correct: 2
  incorrect: -1
created: 2026-05-10
license: CC-BY-4.0
spec_version: "0.3"
---

Level 2: Per-question fenced block

A ```quiz block placed immediately after the question heading overrides global parameters for that specific question.

markdown
## Q3 · Match each element to its geological period.

```quiz
id: geo-match-01
type: match
points: 6
hint: "Think about the geological time scale"
difficulty: hard
tags: [geology, chronology]
bloom: application
```

Per-question field reference

FieldTypeDescription
idstringStable unique identifier for this question
typeenummcq, multi, open, tf, match, or order, inferred if absent
pointsintPoints for this question (overrides scoring.correct)
timerintPer-question time limit in seconds
hintstringHint shown on demand before submission
difficultyenumeasy, medium, or hard
tagsstring[]Per-question thematic tags
bloomenumBloom's taxonomy level
depends_onstringID of a question this one is conditional on

Type inference:

ConditionInferred type
One - [x]mcq
Two or more - [x]multi
___ presentopen
Exactly two choices True / Falsetf

Math support

LaTeX is auto-detected and rendered via KaTeX. No frontmatter flag required.

FormSyntaxRendering
Inline$E = mc^2$Embedded in the line of text
Block$$\int_0^\infty e^{-x}\,dx = 1$$Centred on its own line

Diagram support

QuizMD supports DiagramMD Level 0 fenced blocks in question bodies. See the DiagramMD spec for full syntax and supported types.

Partial scoring

When partial_scoring: true (default), match and order questions award a proportional score.

  • match: score = correct_pairs / total_pairs
  • order: Kendall's tau (concordant pairs / all pairs)

Syntax reference

ElementSyntaxLevel
Quiz title# Title0
Question heading## Q1 or ## Q1 · Title0
Correct choice- [x] text0
Incorrect choice- [ ] text0
Open answer marker___0
Expected answer**Answer:** value0
Per-choice feedback > text (indented)0
Correct-only feedback> [!correct] text0
Incorrect-only feedback> [!incorrect] text0
General feedback> text0
Sub-quiz import!import ./file.quiz.md0
Declare DiagramMD!ref ./file.diagram.md0
Diagram reference```diagram ref:slug0
Declare MediaMD!ref ./file.media.md0
Declare GlossaryMD!ref ./file.glossary.md0
Inline math$formula$0
Block math$$formula$$0
Image via MediaMD![alt](media:slug "fallback")0
Direct image![alt](url)0
Diagram block```{type} [caption:"..."] [alt:"..."]0
Frontmatter--- YAML ---1
Per-question config```quiz YAML ```2

Validation

Lenient mode (default)

ConditionLevel
lang absent from frontmatterWarning
title absent (no H1 and no frontmatter title)Warning
No correct answer in an MCQWarning
Unclosed ```quiz blockError
!import pointing to a missing fileWarning
!ref pointing to a missing fileWarning
media:slug without a matching !ref MediaMDWarning
media:slug without a fallback URLWarning
Frontmatter YAML parse errorError

Strict mode (--strict)

ConditionLevel
lang absentError
title absentError
No correct answer in any questionError
!ref pointing to a missing fileError
media:slug without a fallback URLError
All lenient-mode errorsError

Changes from v0.2

ElementChange
langPromoted from "not required" to required: alignment with LearnSpec charter
titleDemoted from "required" to optional: inferred from the first # H1
FrontmatterAdded created, updated, license (universal LearnSpec fields)
!refNew directive, declares DiagramMD, MediaMD and GlossaryMD contexts
Diagram referenceNew ```diagram ref:slug block, resolves a named diagram from a !ref-ed DiagramMD
ImagesNew media:slug syntax via MediaMD in question bodies
DiagramsExplicit support for DiagramMD Level 0 blocks in question bodies
ABCSection removed, delegates to DiagramMD spec
PrinciplesAdded "LearnSpec-interoperable"
Frontmatterdomain renamed to kind (avoids conflict with email-style domain meaning)
!importNested imports forbidden, !import directives in imported files are inert; authors must lift every import to the entry file

Released under the MIT License.