8000 GitHub - trixtur/cli-quiz: A quiz application which runs in the command-line interface · GitHub
[go: up one dir, main page]

Skip to content
trixturPublic

About

A quiz application which runs in the command-line interface

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

17 Commits

Folders and files

Repository files navigation

Quiz CLI

Command-line quiz runner for multiple-choice question sets stored in JSON.

Running

  • From this folder: go run .
  • Or build a binary: go build ./... then run ./quiz-cli
  • Controls: use ↑/↓ then Enter to select, or type A–D and Enter. Press / to search, Ctrl+C to quit early (a partial grade is shown).
  • Web UI: go run . -mode web -addr :8080 then open http://localhost:8080. Click Try Again (header or summary) to see your current grade, then hit Ready! to restart.

Question File Format

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 answer is used; keep it aligned with an option key.
  • Options are rendered alphabetically by their keys; stick to single-letter keys for clarity.

About

A quiz application which runs in the command-line interface

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0