mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-05-08 09:57:21 -05:00
[PR #1414] [MERGED] fix(staffml/practice): apply effectiveMaxScore to score buttons and save handler #9086
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/harvard-edge/cs249r_book/pull/1414
Author: @Shashank-Tripathi-07
Created: 4/20/2026
Status: ✅ Merged
Merged: 4/20/2026
Merged by: @profvjreddi
Base:
dev← Head:fix/practice-effective-max-score📝 Commits (1)
5851006fix(staffml/practice): apply effectiveMaxScore when saving and disabling score buttons📊 Changes
1 file changed (+3 additions, -3 deletions)
View changed files
📝
interviews/staffml/src/app/practice/page.tsx(+3 -3)📄 Description
What is the bug
In the Practice page, when a user finishes answering a question, they self-score using four buttons: Skip, Wrong, Partial, Nailed It.
Two things are supposed to cap how high a user can score themselves:
The code already computed the correct combined cap in
effectiveMaxScore. But the actual save call and the disabled check on the buttons both usedmaxScore(napkin math only), ignoringeffectiveMaxScoreentirely. So the rubric cap was never enforced.In practice: a user whose rubric said Wrong could still click Nailed It and save a score of 3. The rubric suggestion was shown visually but had zero effect on what got stored.
The fix
Three one-line changes in
practice/page.tsx, all replacingmaxScorewitheffectiveMaxScore:handleScore: the saved score is now capped by both napkin math and rubricdisabledcheck: buttons above the effective cap are greyed outonClick: same cap applied on clickHow to verify
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.