WeBWorK Problems

List objects don't preserve typesetting for correct answers

List objects don't preserve typesetting for correct answers

by Danny Glin -
Number of replies: 1
Is there a way to have a list object display the typeset version of the correct answers?

For example, the following code snippet:
ANS(Compute("1+sqrt(2)")->cmp());
displays the correct answer as the typeset 1+sqrt(2)

, whereas
ANS(List(Compute("1+sqrt(2)"),Compute("1-sqrt(2)"))->cmp());
displays only the numerical values of the two answers as decimals.

Is there some way to have the list object preserve the strings that were passed to it for typesetting as correct answers?  I'd prefer my students to see the more meaningful exact value correct answer to the decimals.
In reply to Danny Glin

Re: List objects don't preserve typesetting for correct answers

by Davide Cervone -
Use
    ANS(Compute("1+sqrt(2),1-sqrt(2)")->cmp);
instead. There is no reason to use List() directly, just use Compute() to parse exactly what you want the students to type.