Command-line quiz runner for multiple-choice question sets stored in JSON.
- From this folder:
go run . - Or build a binary:
go build ./...then run./quiz-cli - Controls: use
↑/↓then Enter to select, or typeA–Dand Enter. Press/to search,Ctrl+Cto quit early (a partial grade is shown). - Web UI:
go run . -mode web -addr :8080then openhttp://localhost:8080. Click Try Again (header or summary) to see your current grade, then hit Ready! to restart.
Create a questions.json beside the executable. It must be a JSON array of objects with these fields:
domain(number): arbitrary grouping value (shown in the UI).question(string): the prompt text.options(object): keys are option letters (A–D recommended), values are the answer texts.answer(string): the correct option key (e.g.,"C").
Example:
[
{
"domain": 1,
"question": "What color is the sky on a clear day?",
"options": {
"A": "Green",
"B": "Blue",
"C": "Red",
"D": "Purple"
},
"answer": "B"
}
]Notes: 5331
- Only the first character of
answeris used; keep it aligned with an option key. - Options are rendered alphabetically by their keys; stick to single-letter keys for clarity.