MathQ / replit.md
Mr-67's picture
Upload 3 files
644c189 verified
|
Raw History Blame Contribute Delete
1.57 kB

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