I recently updated our WeBWorK server to 2.16 and I am now testing the LTI connection from Canvas to WeBWorK. When I click on an assignment in Canvas (set up in homework GradeMode), I am taken to the homework set fine. I click on a problem, answer one of the questions, click grade, and the grade is reported to be successfully sent back to the LMS. But then if I answer another question in that same problem and click grade, this time I am told that the grade is NOT successfully sent back to the LMS. And subsequent grading also is not successfully sent back. But it seems that if I wait a sufficient amount of time and come back to the problem set via Canvas, then the first grade attempt will be successfully sent back again.
Below is the LTI debugging report. Halfway down there is a "duplicate nonce detected" error message. I know this is not because of the timing issue that I reported last year because the new debugging code added to 2.16 reports that the difference between the server time and the oauth_nonce is always less than 5 seconds in the various tests I've done.
Any suggestions on what might be causing this and how to resolve it?
submitting grade for user: testuser1 set Optimization
Submitting grade using sourcedid: 93-65-8585-481-43a1090ab9cbf3de4f6e28f8ebcaaf68be8bf449 and score: 0.06
The request was:
_uri https://agnesscott.instructure.com/api/lti/v1/tools/93/grade_passback _headers HTTP::Headers=HASH(0x560407868618) _uri_canonical https://agnesscott.instructure.com/api/lti/v1/tools/93/grade_passback _content <?xml version = "1.0" encoding = "UTF-8"?>
<imsx_POXEnvelopeRequest xmlns = "http://www.imsglobal.org/services/ltiv1p1/xsd/imsoms_v1p0">
<imsx_POXHeader>
<imsx_POXRequestHeaderInfo>
<imsx_version>V1.0</imsx_version>
<imsx_messageIdentifier>999999123</imsx_messageIdentifier>
</imsx_POXRequestHeaderInfo>
</imsx_POXHeader>
<imsx_POXBody>
<replaceResultRequest>
<resultRecord>
<sourcedGUID>
<sourcedId>93-65-8585-481-43a1090ab9cbf3de4f6e28f8ebcaaf68be8bf449</sourcedId>
</sourcedGUID>
<result>
<resultScore>
<language>en</language>
<textString>0.06</textString>
</resultScore>
</result>
</resultRecord>
</replaceResultRequest>
</imsx_POXBody>
</imsx_POXEnvelopeRequest> _method POST at /opt/webwork/webwork2/lib/WeBWorK/Authen/LTIAdvanced/SubmitGrade.pm line 472.
The nonce used is 378d6709-33ac-58a2-83a0-7a6e48d5bc64__-step2
The response is:
_headers HTTP::Headers=HASH(0x560407bd61b8) _protocol HTTP/1.1 _content {"errors":[{"message":"Duplicate nonce detected"}]} _request HTTP::Request=HASH(0x560407868288) _rc 401 _msg Unauthorized at /opt/webwork/webwork2/lib/WeBWorK/Authen/LTIAdvanced/SubmitGrade.pm line 474.
The request was:
_uri https://agnesscott.instructure.com/api/lti/v1/tools/93/grade_passback _headers HTTP::Headers=HASH(0x560407868618) _uri_canonical https://agnesscott.instructure.com/api/lti/v1/tools/93/grade_passback _content <?xml version = "1.0" encoding = "UTF-8"?>
<imsx_POXEnvelopeRequest xmlns = "http://www.imsglobal.org/services/ltiv1p1/xsd/imsoms_v1p0">
<imsx_POXHeader>
<imsx_POXRequestHeaderInfo>
<imsx_version>V1.0</imsx_version>
<imsx_messageIdentifier>999999123</imsx_messageIdentifier>
</imsx_POXRequestHeaderInfo>
</imsx_POXHeader>
<imsx_POXBody>
<replaceResultRequest>
<resultRecord>
<sourcedGUID>
<sourcedId>93-65-8585-481-43a1090ab9cbf3de4f6e28f8ebcaaf68be8bf449</sourcedId>
</sourcedGUID>
<result>
<resultScore>
<language>en</language>
<textString>0.06</textString>
</resultScore>
</result>
</resultRecord>
</replaceResultRequest>
</imsx_POXBody>
</imsx_POXEnvelopeRequest> _method POST at /opt/webwork/webwork2/lib/WeBWorK/Authen/LTIAdvanced/SubmitGrade.pm line 475.