[PR #1414] [MERGED] fix(staffml/practice): apply effectiveMaxScore to score buttons and save handler #9086

Closed
opened 2026-05-03 01:19:35 -05:00 by GiteaMirror · 0 comments
Owner

📋 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: devHead: fix/practice-effective-max-score


📝 Commits (1)

  • 5851006 fix(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:

  1. Napkin math accuracy (if their math was off, the cap lowers)
  2. Rubric score (if their rubric checkboxes suggest a lower score, the cap lowers further)

The code already computed the correct combined cap in effectiveMaxScore. But the actual save call and the disabled check on the buttons both used maxScore (napkin math only), ignoring effectiveMaxScore entirely. 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 replacing maxScore with effectiveMaxScore:

  • handleScore: the saved score is now capped by both napkin math and rubric
  • Button disabled check: buttons above the effective cap are greyed out
  • Button onClick: same cap applied on click

How to verify

  1. Open Practice on any question that has rubric items
  2. Check only the first rubric checkbox (low score suggestion)
  3. The higher score buttons should now be disabled
  4. Before this fix they were always enabled regardless of rubric

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/harvard-edge/cs249r_book/pull/1414 **Author:** [@Shashank-Tripathi-07](https://github.com/Shashank-Tripathi-07) **Created:** 4/20/2026 **Status:** ✅ Merged **Merged:** 4/20/2026 **Merged by:** [@profvjreddi](https://github.com/profvjreddi) **Base:** `dev` ← **Head:** `fix/practice-effective-max-score` --- ### 📝 Commits (1) - [`5851006`](https://github.com/harvard-edge/cs249r_book/commit/585100696039b03d0042920233d6fe67958057f4) fix(staffml/practice): apply effectiveMaxScore when saving and disabling score buttons ### 📊 Changes **1 file changed** (+3 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `interviews/staffml/src/app/practice/page.tsx` (+3 -3) </details> ### 📄 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: 1. Napkin math accuracy (if their math was off, the cap lowers) 2. Rubric score (if their rubric checkboxes suggest a lower score, the cap lowers further) The code already computed the correct combined cap in `effectiveMaxScore`. But the actual save call and the disabled check on the buttons both used `maxScore` (napkin math only), ignoring `effectiveMaxScore` entirely. 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 replacing `maxScore` with `effectiveMaxScore`: - `handleScore`: the saved score is now capped by both napkin math and rubric - Button `disabled` check: buttons above the effective cap are greyed out - Button `onClick`: same cap applied on click ## How to verify 1. Open Practice on any question that has rubric items 2. Check only the first rubric checkbox (low score suggestion) 3. The higher score buttons should now be disabled 4. Before this fix they were always enabled regardless of rubric --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-03 01:19:35 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/cs249r_book#9086