Skip to content

don't let a negative score be reported #1299

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 5, 2025

Conversation

Alex-Jordan
Copy link
Contributor

Answers for this context are finite sets, like {1,2,3}. The scoring that happens in for answers attempts to give partial credit for answers like {1}, {1,2}, {1,2,4}, {1,2,3,4} etc. The idea is to use 3 as the denominator (in this case where the correct answer has three numbers) and then for the numerator:

  • +1 for each correct number
  • -1 for each incorrect number or repeat of a correct number

But that can lead to a negative total. It doesn't get recorded int he database as a negative score (I think) but it does lead to students seeing things like "-100% correct" in the feedback.

So the change here ensures that if a negative total has been reached, that will be replaced with 0.

Copy link
Member

@drgrice1 drgrice1 left a comment

Choose a reason for hiding this comment

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

Looks fine to me. Clearly a negative score shouldn't be returned.

Copy link
Member

@pstaabp pstaabp left a comment

Choose a reason for hiding this comment

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

Simple fix.

@drgrice1 drgrice1 merged commit 3f1164e into openwebwork:develop Aug 5, 2025
3 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