\[\int_\mbox{\{ans_rule(10)\}}^\mbox{\{ans_rule(10)\}}\mbox{\{ans_rule(10)\}}dx\]
The code works fine, but if you double click on the displayed formula it shows the formula for the code in a pop up window along with values the student has put in: for example if I put in a lower limit of -1, an upper limit of 1, and the integrand as x then the pop up box contains:
\int_\mbox{<INPUT TYPE=TEXT SIZE=10 NAME="AnSwEr1" VALUE="-1"><INPUT TYPE=HIDDEN NAME="previous_AnSwEr1" VALUE="-1">}^\mbox{<INPUT TYPE=TEXT SIZE=10 NAME="AnSwEr2" VALUE="1"><INPUT TYPE=HIDDEN NAME="previous_AnSwEr2" VALUE="1">}\mbox{<INPUT TYPE=TEXT SIZE=10 NAME="AnSwEr3" VALUE="x"><INPUT TYPE=HIDDEN NAME="previous_AnSwEr3" VALUE="x">}dx
This happens in Firefox, I have not tried it in IE. Is there a way to prevent this from happening?
The usual way to do this is via a table. See my earlier post for an example of how to do that.
If you are forcing everyone to use jsMath mode, then you can use the code that you have given, but you are right that double-clicking the equation does produce the display that you indicated in your message. The best way I can think of to handle this is to disable jsMath's double-click function. You can do that by adding
TEXT(MODES( TeX => "", HTML => "<SCRIPT>if (window.jsMath) {jsMath.Click.DblClick = function () {}}</SCRIPT>" ));to your problem file. It is also possible to disable double-click on a global basis by changing the setting of processDoubleClicks in the $pg{displayModeOptions}{jsMath} variable (search for it in global.conf. You can change this setting on a course-by-course basis by adding
$pg{displaModeOptions}{jsMath}{processDoubleClicks} = 0;to the course.conf file for the course you want to change.
Hope that helps.
Davide
TEXT(MODES( TeX=>'', HTML_jsMath => '', HTML=>$HR."Warning: to use this problem, you need to ". "select jsMath mode in the Options panel at the left".$HR, ));It might even be possible to use CSS styles to prevent the rest of the problem from being displayed at all outside of jsMath mode.
You could put this (and the code to turn off double clicks) into a macro file and use loadMacros() to load it and have the code executed automatically. That would make it easier to adjust the error message for all files at once, for example. You can put the macro file in the same directory as the problem files, or in your course templates/macros directory, or make your own macro library directory and include it in the search path by changing the path variable in global.conf.
Good luck with the problems.
Davide
Am I correct that jsmath is not available in older versions of webwork?No, jsMath has been around since the beginning of WeBWorK2. JsMath was added in early 2004. It is not in WeBWorK 1.x, but there's really no reason to be running that at this point.
Davide