Repository navigation
Make sure score preview on assignment page factors in existing points for readings - #1649
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Reusing the rounded running total causes incorrect totals and percentages when initial question scores have multiple decimal places, requiring unrounded score tracking and a fractional-score regression test.
1 open issue
What changed in this PR
This PR updates assignment score previews to preserve reading points when a problem’s score changes.
Changes:
- Adjusts the existing total by the question’s score change instead of recalculating it from question elements.
- Preserves the server-rendered maximum and updates the percentage.
- Adds a regression test covering reading points across repeated problem submissions.
| File | Description |
|---|---|
bases/rsptx/interactives/runestone/common/test/runestonebase_logging.test.js |
Tests that score updates preserve reading points. |
bases/rsptx/interactives/runestone/common/js/runestonebase.js |
Updates assignment totals using question-score differences. |
Review effort: Balanced
f263803 to
78eb546
Compare
|
Force pushed with new approach. Instead of recalculating the total here, have the server return the total it computed as part of the scoreSpec and update displayed score with that. |
There was a problem hiding this comment.
🟡 Changes recommended
Out-of-order question-save responses can overwrite a newer assignment total with a stale value, leaving the preview incorrect even when individual question scores are correct.
1 open issue
1 resolved since last review
Review effort: Balanced
| if (totalSpan && typeof scoreSpec.total_score === "number") { | ||
| let total = scoreSpec.total_score; | ||
| totalSpan.innerHTML = total.toFixed(1); |
There was a problem hiding this comment.
I don't know that we are worried about anyone answering questions that fast.

See Sean's post on Discord. Completing problems on the assignment page is showing a score preview that does not include reading questions. Sol suggested this fix - it just updates the existing score by the question's points instead of trying to recalculate the totals.