feat: add gamified, level-aware practice mode for students - #147
Open
Ritwij07 wants to merge 1 commit into
Open
Conversation
Backend:
- New GET /api/students/:id/practice endpoint. Reuses the existing
generateQuestionsForLevel() level generator (the same one that
powers real worksheet PDFs) so practice questions always match the
student's real currentLevel/currentSubLevel — never a generic or
hardcoded set.
- Skips the Puppeteer/PDF pipeline entirely for speed, since this is
a fast in-class activity, not an official exam paper.
- Optional ?topic= query param to target one weak area at a time.
- Deliberately does NOT mutate the official student.streak or
levelHistory fields used by the assessment-cycle/evaluation
pipeline — practice-session state stays session-local so this
can't interfere with the official 3x/year assessment cycle logic
other in-flight PRs are working on.
- Uses the same getAuthUser/canAccessStudent auth pattern as the
existing diagnostic endpoint.
Frontend:
- New PracticeMode.tsx: an interactive practice session — one
question at a time, immediate correct/incorrect feedback, a live
streak counter, a progress bar, and an end-of-session summary.
Supports the existing number/text/choice question types.
- Wired into PanelViews.tsx's 'Recommended Focus Areas' panel, which
previously only showed static text ('Additional practice
recommended for X') with no action attached to it. Added a
'Start Practice' button plus a per-topic 'Practice this ->' button
so a teacher can launch a session targeted at a specific weak area
directly from the student profile.
This turns currentLevel/currentSubLevel/streak — fields that already
existed in the data model and were only ever displayed as static
numbers — into an actual interactive learning activity, which the
project's own README describes as the goal ('gradual, fun
activities') but nothing in the codebase implemented yet.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backend:
Frontend:
This turns currentLevel/currentSubLevel/streak — fields that already existed in the data model and were only ever displayed as static numbers — into an actual interactive learning activity, which the project's own README describes as the goal ('gradual, fun activities') but nothing in the codebase implemented yet.