Skip to content

Fix the total returned by grade_gateway when the best score is zero. (Hotfix of #3220) - #3221

Open
drgrice1 wants to merge 2 commits into
openwebwork:mainfrom
drgrice1:bugfix/gateway-passback-zero-total-hotfix
Open

drgrice1 wants to merge 2 commits into
openwebwork:mainfrom
drgrice1:bugfix/gateway-passback-zero-total-hotfix

Conversation

@drgrice1

Copy link
Copy Markdown
Member

Previously a set version only replaced the initial [0, 0] best set data if its score was greater than zero. So if a user scored zero on all versions of a test, or had not started the test, the total returned was also zero. For LTI 1.3 grade passback that resulted in a scoreMaximum of zero being sent, which Canvas rejects with "cannot be zero if line item's maximum is not zero".

Now the first version is used if no version has a positive score, and if there are no versions the total is computed from the problems assigned to the user for the test.

Previously a set version only replaced the initial [0, 0] best set data if its
score was greater than zero.  So if a user scored zero on all versions of a
test, or had not started the test, the total returned was also zero.  For LTI
1.3 grade passback that resulted in a scoreMaximum of zero being sent, which
Canvas rejects with "cannot be zero if line item's maximum is not zero".

Now the first version is used if no version has a positive score, and if there
are no versions the total is computed from the problems assigned to the user
for the test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This is a more informative message, and Moodle is also now sending a
JSON response (perhaps it always was, and I was confusing this request
with one of the other LTI requests).
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