https://webwork.maa.org/moodle/mod/forum/discuss.php?d=4272
Browsing through the code, it seems the draggableProof macro loads the main javascript code through the "post_header_text" function.
Curiously, this function is present in lib/WeBWorK/ContentGenerator/Problem.pm, but missing in:
lib/WeBWorK/ContentGenerator/GatewayQuiz.pm
The GWQ case seems to be relatively simple, adding one line like:
print CGI::div({class=>"problem-header"} ,$pg->{post_header_text}) if $pg->{post_header_text};
appears to work. (But this is just a proof of concept, I don't know if it'd break anything else.)
In the XMPRPC case:
For the post_header_text data of the pg file to be passed onto WebworkClient/simple_format.pl, for example, it appears one has to alter at least the following files:
WebworkWebservice/RenderProblem.pm
WebworkClient.pm
FormatRenderedProblem.pm
WebworkClient/simple_format.pl
My question is, was there perhaps a reason not to pass on the post_header_text in the first place?
Making this work for the webwork clients is a matter of passing the post_header_text through to the WebworkClient. I have attached a patch that does this.
Alternately, you could modify the macro to use HEADER_TEXT instead of POST_HEADER_TEXT. That already is passed through to the webwork client formats. That works without server code modification.
Making this work for Gateway quizzes will take more work than just passing the post_header_text through. There are other problems in that case. It might probably work if there is only one draggable proof problem per page, but would have conflicts if multiple draggable proof problems are on the same page.
Note that as of ww-2.16 (not yet released) HEADER_TEXT will also work with Gateway quizzes, although POST_HEADER_TEXT still won't (unless that changes in the next few weeks).
Thank you very much for the update on the current status of this issue, and for the patch! Yea, I figured it would probably be easier to alter the macro instead.
Out of curiosity, would it be possible to have multiple draggableproof problems on the same page of a gateway quiz in 2.16? It seems in the current design each problem is blind to other problems rendered on the same page, so the macro would need to be further altered before being used in a quiz, no?
Even with ww-2.16 the macro would need to be further altered to work with other problems on the page.
Ok, I see, thanks!