In
Webwork 1.9, I tried to exclusively use the BEGIN_TEXT construction,
but in webwork 2, it doesn't seem to work correctly whereas the
TEXT(EV2(<<EOT)); construction seems fine. From what I can tell,
the problem exists when I try to embed variables into the problem in
tex mode.
Specifically, if you try the following pg file, I get errors, but it works fine if the the TEXT(EV2(<<EOT)); for is used:
DOCUMENT(); # This should be the first executable line in the problem.
loadMacros( PG.pl, PGbasicmacros.pl, PGchoicemacros.pl, PGanswermacros.pl, PGauxiliaryFunctions.pl );
TEXT(&beginproblem); $showPartialCorrectAnswers = 1;
$a1 = random(1,4,1);
$b1 = random(2,5,1);
$x1 = random(1,5,1);
$m1 = $b1/(2*($a1+$b1*$x1)**.5);
BEGIN_TEXT
Let \[ f(x) = \sqrt { $a1 + $b1 x } \]
$PAR
\( f'( $x1 ) = \) \{ans_rule(20) \}
$BR
END_TEXT
$ans = $m1;
&ANS(std_num_cmp($ans));
ENDDOCUMENT(); # This should be the last executable line in the problem.
<| Post or View Comments |>
|