Skip to content

CLI Reference

All quiz management happens through quiz_manager.py.

Prerequisites

pip install supabase
export SUPABASE_URL='https://YOUR_PROJECT.supabase.co'
export SUPABASE_KEY='YOUR_ANON_KEY'

create — Start a new session

python quiz_manager.py create "Lecture 5 Quiz"
Output
✓ Created session: Lecture 5 Quiz
  Code: A3K7N2
  ID: 550e8400-...

The code is what students type to join. Save it.


add-questions — Load questions from a JSON file

python quiz_manager.py add-questions A3K7N2 my_questions.json

Questions are appended — if the session already has questions, new ones are added after them. See Writing Questions for the JSON format.


list — Show all active sessions

python quiz_manager.py list
Output
Active Sessions:
------------------------------------------------------------
  A3K7N2  |  Lecture 5 Quiz                  |  2025-02-05
  B8M4P9  |  Midterm Review                  |  2025-02-03
------------------------------------------------------------

summary — Print results to the terminal

python quiz_manager.py summary A3K7N2
Output
============================================================
Session: Lecture 5 Quiz (A3K7N2)
============================================================

Q1: What is 2 + 2?
    Total responses: 25
      3                    ░░░░░░░░░░░░░░░░░░░░   2 (8.0%)
    ✓ 4                    ████████████████████░  20 (80.0%)
      5                    ██░░░░░░░░░░░░░░░░░░   2 (8.0%)
      6                    █░░░░░░░░░░░░░░░░░░░   1 (4.0%)

export — Save results as JSON

# Print to terminal
python quiz_manager.py export A3K7N2

# Save to file
python quiz_manager.py export A3K7N2 results.json

The JSON output includes vote counts, percentages, and per-option breakdowns.


Typical class-day workflow

# Before class: create session, load questions
python quiz_manager.py create "Week 3 Quiz"
python quiz_manager.py add-questions X9Y2Z4 week3_questions.json

# During class: open presenter.html in the browser

# After class: export
python quiz_manager.py export X9Y2Z4 week3_results.json