← Docs

Quizzes YAML Schema

Drop a quizzes/*.yml file in your repo and TeachRepo auto-grades it. Supports multiple-choice, true/false, and short-answer questions.

Full schema example

# quizzes/intro-quiz.yml
id: intro-quiz
title: "Git Basics Quiz"
pass_threshold: 70         # percentage correct to pass
questions:
  - type: multiple_choice
    prompt: "What does 'git commit' do?"
    options:
      - "Saves changes to the remote"
      - "Records changes to the local repo"    # ← correct
      - "Deletes the staging area"
      - "Creates a new branch"
    answer: 1              # 0-indexed, or list for multi-select
    explanation: "git commit records staged changes to your local history."
    points: 2

  - type: true_false
    prompt: "A Git branch is a pointer to a commit."
    answer: true
    explanation: "Branches are just lightweight movable pointers."
    points: 1

  - type: short_answer
    prompt: "Name the command that shows the commit log."
    answer: "git log"      # case-insensitive, trimmed
    explanation: "git log shows the commit history."
    points: 1

Top-level fields

FieldRequiredDescription
idYesMatches quiz_id in lesson frontmatter
titleYesDisplay name shown above the quiz
pass_thresholdNoMin % correct to pass (default: 70)
questionsYesArray of question objects (see below)

Question types

multiple_choice

Fields: prompt, options (array), answer (0-indexed int or int[]), explanation, points

Set answer to an array for multi-select questions.

true_false

Fields: prompt, answer (true | false), explanation, points

Renders as two radio buttons.

short_answer

Fields: prompt, answer (string), explanation, points

Case-insensitive, whitespace-trimmed match.

AI quiz generation

Don't want to write quizzes by hand? Use the dashboard's AI Quiz Generator:

  1. Open a lesson in your Dashboard → Course editor
  2. Click Generate quiz from lesson
  3. Set the number of questions (3–10) and click Generate
  4. Edit any questions, then click Save quiz

The AI reads your lesson content and produces a ready-to-use YAML quiz. You can export it back to your repo.

Next: Payments & Affiliates →← Repo Format