Skip to content

Fix division by zero in {Full,Half}CreditSet Items.#2966

Open
somiaj wants to merge 1 commit intoopenwebwork:WeBWorK-2.21from
somiaj:bugfix-credit-set-items
Open

Fix division by zero in {Full,Half}CreditSet Items.#2966
somiaj wants to merge 1 commit intoopenwebwork:WeBWorK-2.21from
somiaj:bugfix-credit-set-items

Conversation

@somiaj
Copy link
Copy Markdown
Contributor

@somiaj somiaj commented May 3, 2026

If the total weight of a set is zero, due to either no problems in a set or weights set to zero, these items cause a division by zero not allowing a user to see the associated ProblemSet page.

This returns 0 in the can_use methods before dividing by zero in this case, fixing the issue.

If the total weight of a set is zero, due to either no
problems in a set or weights set to zero, these items
cause a division by zero not allowing a user to see the
associated ProblemSet page.

This returns 0 in the can_use methods before dividing by
zero in this case, fixing the issue.
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.

2 participants