DOCUMENT();
loadMacros("parserFunction.pl",);
TEXT(beginproblem());
parserFunction(f => "2x");
BEGIN_TEXT
\( f(2) = \) \{ Compute( "f(2)" ) \}
END_TEXT
ENDDOCUMENT();
This prints f(2)=4 nicely, and I can figure out how to have the answer blank check again 4 the value of f(2), but I can't figure out how to have it check against "f(2)" the actual string. As a work around, I have been using a string compare, but it seems like maybe there is a classier way to do this. Especially when it comes to decimals-f(1/2) should be a correct answer to f(.5), but a string comparison will miss that.
Any help would be greatly appreciated!