Skip to content

Commit 2793a5b

Browse files
Kyle ParkerKyle Parker
authored andcommitted
Add web app documentation guide
1 parent 656fae7 commit 2793a5b

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ This project is licensed under the MIT License. See the [LICENSE](LICENSE) file.
8282
## Employer Quick Links
8383
- Project brief: `docs/PROJECT_BRIEF.md`
8484
- Resume bullets: `docs/RESUME_BULLETS.md`
85+
- Web app guide: `docs/WEB_APP_GUIDE.md`
8586
- Security policy: `SECURITY.md`
8687
- Contribution guide: `CONTRIBUTING.md`
8788
- Code of conduct: `CODE_OF_CONDUCT.md`

docs/WEB_APP_GUIDE.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Web App Guide
2+
3+
## Overview
4+
`web_app.py` provides a beginner-friendly Flask interface for Code Quest.
5+
It teaches Python concepts with:
6+
- One concept per lesson
7+
- Immediate feedback
8+
- Hints and gentle explanations
9+
- Score and progress tracking in session
10+
11+
## Run locally
12+
```bash
13+
cd "/Users/kyleparker/Documents/code game"
14+
pip3 install -r requirements.txt
15+
python3 web_app.py
16+
```
17+
18+
Open `http://127.0.0.1:5000`.
19+
20+
## Routes
21+
- `GET /` dashboard and progress summary
22+
- `GET /python` active lesson page
23+
- `POST /python` answer submission + feedback
24+
- `POST /python/continue` continue after review-mode
25+
- `POST /reset` reset score/progress
26+
27+
## Where lessons live
28+
Lesson definitions are in `_python_lessons()` inside `web_app.py`.
29+
Each lesson includes:
30+
- `title`, `concept`, `prompt`
31+
- `checker` function
32+
- `hint`
33+
- explanation blocks (`explanation`, `gentle_explanation`, `solution_breakdown`)
34+
- `example` and `model_answer`
35+
36+
## How to add a new lesson
37+
1. Add a new `PythonChallenge` in `default_python_challenges()` in `game.py`.
38+
2. Add a matching lesson object in `_python_lessons()` in `web_app.py`.
39+
3. Keep explanations beginner-safe and concrete.
40+
4. Run tests:
41+
```bash
42+
python3 -m unittest discover -s tests -p "test_*.py" -v
43+
```

0 commit comments

Comments
 (0)