WeBWorK Main Forum

Reporting of scores from WW to Canvas is now failing - what to do?

Reporting of scores from WW to Canvas is now failing - what to do?

by Larry Riddle -
Number of replies: 0

Several days ago I posted in https://webwork.maa.org/moodle/mod/forum/discuss.php?d=4770 that when grading a problem in WeBWorK using LTI authorization from Canvas, WW would generate the error message

Can't use string ("{"errors":[{"message":"Duplicate"...) as a HASH ref while "strict refs" in use at /opt/webwork/webwork2/lib/WeBWorK/Authen/LTIAdvanced/SubmitGrade.pm line 193

I have gone back to a course from last semester that successfully used LTI from Canvas to WW, changed the close date for one of the problem sets to next week, then used the link in Canvas to go to the problem set and grade a problem. I got the same error message as above. So it now appears that this error might be affecting all of our courses that try to send grades from WW back to Canvas.

For the class that starts this coming Monday, I have set $LTIGradeOnSubmit=0. Upon testing, this stops the error message and will allow the students to see the result of the grading. I have set $LTIMassUpdateInterval = 1200 to see if we can at least get the scores updated periodically, but after checking many times it appears this is not working either. No scores are showing up in the gradebook. I should note that I am doing this as a student enrolled in the course, but the course has not started yet so at the moment I am the only "student" accessing WW from Canvas. But the net effect is that at the moment we have no way for WW to send the scores back to Canvas and the instructor will have to do this manually, which kind of defeats one of the purposes for using LTI.

I have tried commenting out all the lines in the subroutine local_escape_html in SubmitGrade.pm which is where line 193 is located just to see what would happen. When grading a problem, this stops the error message but the page then says "your score was not successfully sent to the LMS". Just before this subroutine are the following comments

# error in reporting michael.gage@rochester.edu, Demo, Global $r object is not available. Set:
#       PerlOptions +GlobalRequest
# in httpd.conf at /opt/rh/perl516/root/usr/local/share/perl5/CGI.pm line 346, <IN> line 76.
# so we don't use CGI::escapeHTML in post processing mode but use this local version instead.

We are using version 2.14 of WeBWorK.

Thanks for any help in getting this issue resolved.