Drop a quizzes/*.yml file in your repo and TeachRepo auto-grades it. Supports multiple-choice, true/false, and short-answer questions.
# 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| Field | Required | Description |
|---|---|---|
| id | Yes | Matches quiz_id in lesson frontmatter |
| title | Yes | Display name shown above the quiz |
| pass_threshold | No | Min % correct to pass (default: 70) |
| questions | Yes | Array of question objects (see below) |
multiple_choiceFields: prompt, options (array), answer (0-indexed int or int[]), explanation, points
Set answer to an array for multi-select questions.
true_falseFields: prompt, answer (true | false), explanation, points
Renders as two radio buttons.
short_answerFields: prompt, answer (string), explanation, points
Case-insensitive, whitespace-trimmed match.
Don't want to write quizzes by hand? Use the dashboard's AI Quiz Generator:
The AI reads your lesson content and produces a ready-to-use YAML quiz. You can export it back to your repo.