# Math Quiz App A multiplication quiz web application built with Python Flask. ## Overview Users configure a quiz (number range, question count, difficulty), answer timed multiplication questions, and view results on a leaderboard. ## Architecture - **Backend**: Python 3.12 + Flask - **Frontend**: Jinja2 HTML templates (server-side rendered) - **Storage**: `leaderboard.json` file (local JSON file for scores) ## Project Structure ``` main.py # Flask app with all routes templates/ configure_quiz.html # Quiz setup form quiz.html # Question page with countdown timer summary.html # End-of-quiz results submit_score.html # Score submission form leaderboard.html # Leaderboard display index.html # (unused) leaderboard.json # Persisted leaderboard data (auto-created) ``` ## Routes - `GET/POST /` — Configure quiz (number range, difficulty, question count) - `GET/POST /quiz` — Active quiz with per-question countdown timer - `GET/POST /summary` — Quiz results summary - `POST /submit_score` — Save score to leaderboard - `GET /leaderboard` — View all scores ## Running **Development:** `python main.py` (Flask dev server on port 5000) **Production:** `gunicorn --bind=0.0.0.0:5000 --reuse-port main:app` ## Dependencies - `flask` — Web framework - `gunicorn` — Production WSGI server ## Workflow - Workflow: `Start application` → `python main.py` on port 5000 (webview) ## Deployment - Target: autoscale - Run: `gunicorn --bind=0.0.0.0:5000 --reuse-port main:app`