WeBWorK Problems

Negative mixed numbers are not handled correctly

Re: Negative mixed numbers are not handled correctly

by Davide Cervone -
Number of replies: 0
This is a bug in contetFraction.pl. I have fixerd it in the latest HEAD version, so check that out of the CVS repository to get the fix. Thanks for the bug report.

Incidentally, there are two improvements I'd recommend for your code snippet above. First, you don't need the Compute() in the ANS call, as $ansa is already a MathObject, so computing it again is a waste of time.

Second, you can use $ansa to generate the fraction in the text of the problem rather than having to write the LaTeX yourself, but you have to force it to use showMixedNumbers=>0 to get it to show as a pure fraction:

    \(\{$ansa->with(showProperFractions=>0)\} =\) \{ans_rule(35)\}
That way you don't have to have the same fraction twice and run the risk of getting the two instances out of synchronization when you change the definition of $ansa later. :-)