Skip to content

Make sure score preview on assignment page factors in existing points for readings - #1649

Merged
bnmnetp merged 3 commits into
RunestoneInteractive:mainfrom
ascholerChemeketa:assignment-page-grading-fix
Nov 6, 2026
Merged

bnmnetp merged 3 commits into
RunestoneInteractive:mainfrom
ascholerChemeketa:assignment-page-grading-fix

Conversation

@ascholerChemeketa

Copy link
Copy Markdown
Contributor

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.

Copilot AI balanced review requested due to automatic review settings November 4, 2026 07:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

@ascholerChemeketa
ascholerChemeketa force-pushed the assignment-page-grading-fix branch from f263803 to 78eb546 Compare November 6, 2026 15:53
Copilot AI balanced review requested due to automatic review settings November 6, 2026 15:53
@ascholerChemeketa

Copy link
Copy Markdown
Contributor Author

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment on lines +262 to +264
if (totalSpan && typeof scoreSpec.total_score === "number") {
let total = scoreSpec.total_score;
totalSpan.innerHTML = total.toFixed(1);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know that we are worried about anyone answering questions that fast.

@bnmnetp
bnmnetp merged commit 4135a52 into RunestoneInteractive:main Nov 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants