Here's my guess as to what is happening, and a possible workaround. The help(keyword)
syntax is coming from AnswerFormatHelp.pl
, which works by embedding a javascript function in the rendered problem that opens the help window on a click on the help text. In a gateway assignment, the problem isn't being rendered the same way (in particular, because there are several problems that are being rendered in the same gateway assignment page, there the header material probably gets discarded).
Possible workaround: embed the desired function in the problem explicitly. This means that we'd be redefining it if the problem is used in a regular problem set, but that shouldn't be an issue. To this we have to get into the rendering of the HTML for the problem; the following is an outline of what I think should work.
[problem header] TEXT(MODES(TeX=>'',HTML=><<EOT)); <script type="text/javascript"> <!-- function openhelpUnits() { OpenWindow=window.open("","answer_format_help","width=550,...); ... OpenWindow.document.close() self.name="main" if (window.focus) {OpenWindow.focus()} return false; } --> EOT $linkText = TEXT(MODES(TeX=>'help(units)',HTML=>'<a href="#" onclick="return openhelpUnits();">help(units)</a>')); TEXT(beginproblem()); Context()->texStrings; BEGIN_TEXT [etc] $linkText
Here the [problem header]
information is whatever is in the problem header, up to where we're rendering the problem. I've copied the text of the javascript function (here, openhelpUnits
, for help on units) from the macro file pg/macros/FortLewis/AnswerFormatHelp.pl
.
For what it's worth,
Gavin
...Oops. Just noticed that I dropped the ending </script>
tag from the end of the "here" text defined by <<EOT...EOT
.
But you saw that where I didn't, I am sure.
Gavin