An explainable, console-based adaptive learning system that helps children (ages 5–10) practice basic math.
The prototype generates puzzles, tracks performance, and automatically adjusts difficulty to keep learners in their optimal challenge zone.
This project demonstrates how AI-style personalization can be implemented with a lightweight, rule-based adaptive engine.
- Three difficulty levels: Easy, Medium, Hard
- Dynamic puzzle generation for addition, subtraction, multiplication, and division
- Performance tracking: correctness + response time
- Adaptive difficulty engine (reinforcement-style rule-based model)
- End-of-session summary (accuracy, timing, transitions, recommended level)
- CSV logs for every session (useful for ML training later)
math-adaptive-prototype/
├─ README.md
├─ requirements.txt
├─ src/
│ ├─ main.py
│ ├─ puzzle_generator.py
│ ├─ tracker.py
│ └─ adaptive_engine.py
└─ logs/
cd math-adaptive-prototype
python -m src.mainpython src/main.pyPress q anytime to quit.
flowchart LR
A[Start Session: Name, Level, Count] --> B[Puzzle Generator by Difficulty]
B --> C[Ask Question and Start Timer]
C --> D[Get User Answer]
D --> E[Evaluate Correctness and Time]
E --> F[Performance Tracker]
F --> G[Adaptive Engine]
G -->|Adjust Difficulty| B
F --> H[Session Summary]
Generates math problems for Easy/Medium/Hard levels with child-friendly constraints.
Logs correctness, timing, transitions, and produces summary metrics.
Uses a momentum-based rule:
- Correct = +1
- Incorrect = −1
- Fast = +0.5
- Slow = −0.5
Momentum smooths noise and triggers level up/down automatically.
==== Session Summary ====
Player: Teja
Questions answered: 20
Accuracy: 85.0%
Average time/question: 6.7s
Difficulty transitions: Easy -> Medium (Q8), Medium -> Hard (Q15)
Next recommended level: Medium
- AI-style personalized difficulty adjustment
- Real-time performance tracking
- Lightweight adaptive logic
- Data logging for future ML modeling
To convert the adaptive engine into an ML-driven one:
- Collect logs → derive features
- Train logistic regression / decision tree
- Predict level-up / level-down probabilities
- Replace rule-based logic with learned policy
Each session generates a CSV file in /logs.
- Python 3.9+
- No external libraries required
Optional:
streamlit # UI
rich # pretty console output
- Three difficulty levels
- Adaptive difficulty engine
- Performance tracking
- Modular code
- Summary + CSV logs
- Technical note included
MIT