Quiz Format Documentation

Complete technical specification and examples for authoring quizzes in JSON format.

Quiz JSON Specification

Quizzes are structured JSON documents rendered by the Quiz Renderer as interactive assessments. This page documents the schema, every question type, and the rich-text conventions.

1. Top-Level Schema

{
  "id": "optional-unique-quiz-id",
  "title": "Quantum Mechanics & Thermodynamics Quiz",
  "description": "An interactive assessment covering basic state vectors and heat engines.",
  "coverNotes": [
    "The zeroth law defines temperature: systems in thermal equilibrium share it.",
    "Common mistake: entropy can decrease locally — but never for the system plus its surroundings."
  ],
  "feedbackMode": "immediate",
  "timeLimit": 1800,
  "shuffleQuestions": false,
  "shuffleOptions": false,
  "questions": [/* see §3 */]
}
FieldTypeDefaultDescription
titlestring—The quiz title (required).
descriptionstring—Short summary of what the quiz covers.
coverNotesstring[]—Short important points shown on the cover screen before the quiz starts; supports Markdown + LaTeX. The countdown timer only starts after the learner dismisses the cover.
feedbackMode"immediate" | "deferred" | "none""immediate"immediate grades each question as the learner answers (single/true-false on selection; others via Check Answer); deferred shows results on submit; none hides answers.
timeLimitnumbernoneDuration in seconds. Omit or 0 for no limit.
shuffleQuestionsbooleanfalseRandomize question order each attempt.
shuffleOptionsbooleanfalseRandomize multiple-choice options.
questionsQuestion[]—One or more question objects (§3).

Navigation

Learners move through questions one at a time using Previous, Next, and numbered question pills. They can jump to any question at any time — answers and per-question feedback (in immediate mode) are preserved when navigating.

Reattempts

Each quiz session creates a separate attempt record. After submitting, learners can Retake Quiz to start a fresh attempt; all attempts are stored.

2. Rich Text & Math

All visible text fields (text, hint, explanation, label) support Markdown, GFM tables, and LaTeX.

  • Inline LaTeX: $E = mc^2$
  • Display LaTeX: $$\int_{-\infty}^{\infty} e^{-x^2}\,dx = \sqrt{\pi}$$
  • GFM tables:
    | State | Symbol | Value |
    | :--- | :---: | ---: |
    | Ground | $|0\rangle$ | $0\text{ eV}$ |
    | Excited | $|1\rangle$ | $2.5\text{ eV}$ |
    
  • Code blocks: triple backticks with an optional language tag (e.g. ```python).

3. Question Types

Every question inherits these fields (defaults shown):

FieldTypeDefaultNotes
idstring—Unique within the quiz (required).
textstring—Markdown + LaTeX (required).
hintstring—Optional extra context shown under the question.
topicstring—Optional topic/section tag (1–100 chars). See §3.0.
explanationstring—Optional, shown with feedback.
pointsnumber1Must be positive.

Per-type fields are listed below.

3.0 Topic Tags & Stratified Practice — topic

Tag every question with a short topic name and the quiz becomes a stratified practice bank:

{ "id": "q1", "type": "single", "topic": "Data Quality", "text": "...", "options": [...], "answer": "opt_a" }

What changes once at least two distinct topics exist in a quiz:

  • Practice sessions — the quiz detail page offers Practice 10 / 15 / 20: a short attempt that samples a fixed number of questions with at least one from every topic, the rest proportional to how many questions each topic holds.
  • Least-recently-seen — within a topic, questions you answered longest ago (or never) are picked first, so repeated sessions eventually cover the whole bank.
  • Topic-grouped navigator — the question navigator groups its pills under topic headings.
  • Per-topic results — the results screen shows a correct/total bar per topic.

Rules for authors: keep topic names short and consistent (same spelling and capitalisation everywhere — tags are matched exactly); one topic per question; questions without a topic share a fallback "General" stratum. Untagged quizzes are unaffected: no Practice button, flat navigator, classic scoring.

Authoring via the AI Generator: pick the Stratified mode and the prompt instructs the model to tag every question and work to a per-topic budget. Classic mode produces an ordinary capped quiz without tags.

3.1 Single Choice — "single"

Radio group, exactly one correct option. In immediate feedback mode, selecting an option grades the question instantly.

{
  "id": "q1",
  "type": "single",
  "points": 2,
  "text": "Eigenvalue equation for the Hamiltonian $\\hat{H}$?",
  "options": [
    { "id": "opt_a", "label": "$\\hat{H}\\psi = E\\psi$" },
    { "id": "opt_b", "label": "$\\hat{H}\\psi = \\frac{\\partial \\psi}{\\partial t}$" },
    { "id": "opt_c", "label": "$\\nabla^2 \\psi = 0$" },
    { "id": "opt_d", "label": "$\\hat{p} = -i\\hbar\\nabla$" }
  ],
  "answer": "opt_a",
  "explanation": "Time-independent Schrödinger: $\\hat{H}\\psi = E\\psi$."
}

3.2 Multiple Choice — "multiple"

Checkboxes; all listed options must be selected. In immediate feedback mode, the learner presses Check Answer to grade.

{
  "id": "q2",
  "type": "multiple",
  "points": 3,
  "text": "Which of these are Maxwell's equations? (Select all)",
  "options": [
    { "id": "m1", "label": "$\\nabla \\cdot \\mathbf{E} = \\frac{\\rho}{\\varepsilon_0}$ (Gauss)" },
    { "id": "m2", "label": "$\\nabla \\cdot \\mathbf{B} = 0$ (Gauss Magnetism)" },
    { "id": "m3", "label": "$F = ma$ (Newton 2nd)" },
    { "id": "m4", "label": "$\\nabla \\times \\mathbf{E} = -\\frac{\\partial \\mathbf{B}}{\\partial t}$ (Faraday)" }
  ],
  "answers": ["m1", "m2", "m4"],
  "explanation": "Newton's 2nd is mechanics, not electrodynamics."
}

3.3 True / False — "true-false"

In immediate feedback mode, selecting True or False grades the question instantly.

{
  "id": "q3",
  "type": "true-false",
  "points": 1,
  "text": "Entropy in an isolated system can decrease spontaneously (2nd Law).",
  "answer": false,
  "explanation": "By the 2nd Law, $\\Delta S \\ge 0$ for isolated systems."
}

3.4 Ordering — "ordering"

Drag items into the correct sequence. In immediate feedback mode, the learner presses Check Answer to grade.

{
  "id": "q5",
  "type": "ordering",
  "points": 4,
  "text": "EM spectrum, **lowest to highest** frequency:",
  "items": [
    { "id": "o_radio", "label": "Radio Waves" },
    { "id": "o_ir", "label": "Infrared" },
    { "id": "o_vis", "label": "Visible Light" },
    { "id": "o_uv", "label": "Ultraviolet" },
    { "id": "o_gamma", "label": "Gamma Rays" }
  ],
  "answer": ["o_radio", "o_ir", "o_vis", "o_uv", "o_gamma"],
  "explanation": "Radio ($10^4\\text{ Hz}$) < IR < Visible < UV < Gamma ($10^{20}\\text{ Hz}$)."
}

3.5 Matching — "matching"

Connect left-column prompts to right-column responses. In immediate feedback mode, the learner presses Check Answer to grade.

{
  "id": "q7",
  "type": "matching",
  "points": 4,
  "text": "Match each constant to its symbol:",
  "prompts": [
    { "id": "p_planck", "label": "Planck's Constant" },
    { "id": "p_boltz", "label": "Boltzmann Constant" },
    { "id": "p_speed", "label": "Speed of Light in Vacuum" }
  ],
  "responses": [
    { "id": "r_h", "label": "$h = 6.626 \\times 10^{-34}\\text{ J}\\cdot\\text{s}$" },
    { "id": "r_kb", "label": "$k_B = 1.38 \\times 10^{-23}\\text{ J}/\\text{K}$" },
    { "id": "r_c", "label": "$c = 2.998 \\times 10^8\\text{ m}/\\text{s}$" }
  ],
  "answer": { "p_planck": "r_h", "p_boltz": "r_kb", "p_speed": "r_c" },
  "explanation": "Standard SI constants."
}

4. Quick Reference

  • Every question object must have id, type, and text; everything else is optional unless the type requires it.
  • Supported types for new quizzes: single, multiple, true-false, ordering, matching.
  • answer / answers is the only field that differs structurally between types.
  • Want a model to author quizzes? Use the Copy button in the page header — it drops a compact AI prompt with the schema and a minimal example.