|
Download replit.md from Mr-67/MathQ: direct link, hf CLI and curl.
- Browser
- Download file 1.57 kB
-
https://huggingface.co/spaces/Mr-67/MathQ/resolve/main/replit.md
- Command line
-
hf download hf://spaces/Mr-67/MathQ/replit.md
-
curl -L -o replit.md https://huggingface.co/spaces/Mr-67/MathQ/resolve/main/replit.md
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.jsonfile (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 timerGET/POST /summaryβ Quiz results summaryPOST /submit_scoreβ Save score to leaderboardGET /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 frameworkgunicornβ Production WSGI server
Workflow
- Workflow:
Start applicationβpython main.pyon port 5000 (webview)
Deployment
- Target: autoscale
- Run:
gunicorn --bind=0.0.0.0:5000 --reuse-port main:app