## WeBWorK Problems

### Re: Randomization button fails: "434 setmaker.js: /webwork2/instructorXMLHandler: Forbidden"

by Nathan Wallach -
Number of replies: 5

This sounds like to issue with UTF-8 and XMLRPC which can be fixed by patching /usr/share/perl5/XMLRPC/Lite.pm to support UTF-8 text. AFAIK the "not equals" symbol (used in the PopUp) requires UTF-8 which is the apparent trigger.

 The patch replaces line 55 of /usr/share/perl5/XMLRPC/Lite.pm which originally was: base64 => [10, sub {$_[0] =~ /[^\x09\x0a\x0d\x20-\x7f]/}, 'as_base64'], with the following replacement line: base64 => [10, sub {$_[0] =~ /[^\x09\x0a\x0d\x20-\x7f]/ && !utf8::is_utf8(\$_[0])}, 'as_base64'], 

### Re: Randomization button fails: "434 setmaker.js: /webwork2/instructorXMLHandler: Forbidden"

by Keir Lockridge -
I did the patch and restarted my webservers. Now when I hit the randomize button I get ... quite an error message (see below). Perhaps I can try to avoid the not equals sign.

--Keir

WebworkClient Errors
Errors:
------The current problem set number setNumber is not defined
------The current problem number probNum is not definedinternal_debug_messagescourseIDmath212f2012WARNINGSV0FSTklOR1MKCjxici8+TW9yZTxici8+Cg== at /opt/webwork/webwork2/lib/WebworkClient.pm line 302.

End Errors
WeBWorK error
An error occured while processing your request. For help, please send mail to this site's webmaster (webmaster@localhost), including all of the following information as well as what what you were doing when the error occured.

Thu Jun 11 14:17:02 2020

Warning messages
Error messages
xmlrpcCall to renderProblem returned no result for
Call stack
The information below can help locate the source of the problem.

in WeBWorK::ContentGenerator::instructorXMLHandler::content called at line 233 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm
in WeBWorK::ContentGenerator::go called at line 386 of /opt/webwork/webwork2/lib/WeBWorK.pm
Request information
Method POST
URI /webwork2/instructorXMLHandler
Sec-Fetch-Dest empty
X-Requested-With XMLHttpRequest
Accept-Language en-US,en;q=0.9
Connection keep-alive
Accept */*
Content-Type application/x-www-form-urlencoded; charset=UTF-8
Accept-Encoding gzip, deflate, br
Content-Length 390

### Re: Randomization button fails: "434 setmaker.js: /webwork2/instructorXMLHandler: Forbidden"

by Nathan Wallach -
We are making progress - as the error is now occurring somewhere else, and the message jogged my memory.

You can probably avoid the issue by not using "not equals" or any other UTF-8 as part of an answer... but PopUp will not allow you to use "math" inside the options.

I hope we can instead find the "fixes" you need to solve the problem - and that it will help make sure that the future WW 2.16 (if not 2.15) is really ready for UTF-8 without all these bugs. (It will still probably require the manual patch to Lite.pm as part of the installation procedure.)

UTF-8 support in WW was only added in WW 2.15, and there were issues none of us found during the testing before WW 2.15 was released. For a good while, I was aware that some problems could not be loaded in the library browser or via html2xml in general, but discovering why and finding a fix was quite challenging. We also told students not to use images mode due to one of the issues (see below). I hope that the patches discussed below also fixed the issue you are encountering now.

The "not well-formed (invalid token)" issue seems to have been related to problems where the correct/student answers could contain UTF-8 strings, as the "XMLRPC" system was not properly encoding strings deep inside the data it was passing, in particular for "answer" strings which contained UTF-8 characters. The "not equals" sign would almost certainly trigger that problem (in html2xml and apparently for the "randomization" button).

If my analysis is correct, then I hope that the changes made in the pull request https://github.com/openwebwork/webwork2/pull/1089 which had been merged into the develop branch will solve the problem you are having. I have been using that patched code for a good while, and it seems to solve the issues I had before with some problems in the library browser and with the same problems embedded via html2xml which I ran into before the changes.

Also there was a second issue with UTF-8 answers discussed in https://github.com/openwebwork/pg/issues/443 and likely to effect your problems. The second  issue was a failure to generating the answer table in "images" mode for cases like this. Students would only get an error page and not the feedback, etc. Davide Cervone proposed a fix, and Mike made the fix in https://github.com/openwebwork/pg/pull/466 which is also only in "develop" and not WW 2.15. Since that issue will effect such problems when used by students, if they change to using "images" mode for equation display - it is also something you probably want to consider patching on your system.

Sorry, I should have recalled both these issues when I posted my first response. Hopefully, we will not discover another problem later on.

Nathan

### Re: Randomization button fails: "434 setmaker.js: /webwork2/instructorXMLHandler: Forbidden"

by Keir Lockridge -

Would you advise me to avoid not equals for now and wait for 2.16, or try to install these patches? (I'm content with something like "!=" for now.)

Thanks to you and all the others who are doing the development work!

### Re: Randomization button fails: "434 setmaker.js: /webwork2/instructorXMLHandler: Forbidden"

by Nathan Wallach -
If you have time - help testing patches/development code is always a contribution which helps the project and the community.

I tested the Library browser randomize button with your problem on my laptop which is running some version of the development code, and it worked for me. That is a pretty good indication that the patch mentioned above should solve your problem, so it is likely to just work once WW 2.16 gets released. However, there are plenty of other changes in the develop branch, so it could be some other commit/PR was also part of what fixed the issue. Testing with just the PR 1089 changes would narrow down what the issue and fix is.