A browser-based mental math trainer for quant trading interview preparation. Features timed tests with configurable operations, multiple choice or open answer formats, and localStorage-backed statistics.
- Backend: FastAPI (Python)
- Frontend: HTML, CSS, vanilla JavaScript
- Storage: localStorage (no external database)
- Configuration: Select operations (addition, subtraction, multiplication, division), decimals, percentages, question format, count, and time limit
- Timed test: Countdown timer, score display, skip/return-later, navigation panel
- Scoring: +1 correct, -1 wrong, 0 for skipped (until answered)
- Results: Final score, accuracy, average response time, per-question reaction times
- Statistics: Best score, average accuracy, total sessions, performance by operation type (stored in localStorage)
cd backend
pip install -r requirements.txt
uvicorn main:app --reloadOpen http://localhost:8000 in your browser.
mental-math-prep/
├── backend/
│ ├── main.py # FastAPI app, API, static serving
│ ├── question_generator.py
│ ├── models.py
│ └── requirements.txt
├── frontend/
│ ├── index.html
│ ├── css/styles.css
│ └── js/
│ ├── app.js
│ ├── config.js
│ ├── test.js
│ ├── results.js
│ └── storage.js
└── README.md
POST /api/generate— Request body:{ operations, include_decimals, include_percentages, format, num_questions, total_time_seconds }. Returns array of question objects.