Skip to main content

Quiz format (quiz.json)

The agent writes .know-code/quiz.json before know-code ask. The human answers in the browser.

Schema

{
"diffHash": "<64-hex from know-code hash>",
"level": "lite | standard | deep",
"title": "optional title",
"questions": [
{
"id": "q1",
"prompt": "What does this change do and why?",
"expectedPoints": ["optional rubric hints for agent grading"],
"type": "text",
"choices": []
}
]
}
FieldRequiredNotes
diffHashyesMust match current know-code hash
levelyesUsually matches config level
questionsyesAt least minQuestions from know-code questions
questions[].idyesUnique stable ids (q1, q2, …)
questions[].promptyesShown in browser
expectedPointsnoHelps agent scoring
typenotext (default) or mcq
choicesmcq onlyArray of strings

Workflow

know-code questions --json
know-code questions --template > .know-code/quiz.json
# edit prompts
know-code quiz validate
know-code ask

Validation errors

  • Hash mismatch — re-run questions and rewrite quiz for current diff
  • Too few questions — add questions until minQuestions met
  • Missing ids — every question needs id + prompt

See also: grading, levels.