[system] Repository:
ViewVC logotype

Revision 3172


Jump to revision: Previous Next
Author: dpvc
Date: Tue Feb 15 21:58:54 2005 UTC (14 years, 9 months ago)
Log Message:
Updated the answer checkers so that you can more easily specify how
the correct answer shoudl be displayed.  In the past, you could use
something like Real(sqrt(2))->cmp(correct_ans=>"sqrt(2)") to do this,
but that is awkward.  Now the Compute() function (which parses and
then evaluates a string) sets things up so that the original string
will be what is used as the correct answer.  That means
Compute("sqrt(2)")->cmp will have the same result as the example
above.

You can also set the {correct_ans} properly of any Parser object to
have that value used as the correct answer.  For example

     $x = Real(sqrt(2));
     $x->{correct_ans} = "sqrt(2)";
     ANS($x->cmp)

would also produce the same answer checker as the two previous
examples.  All three methods should work.  Use the one that is most
convenient for you.

Changed paths:

Path Details
Directorytrunk/pg/lib/Value/AnswerChecker.pm modified , text changed
Directorytrunk/pg/macros/Parser.pl modified , text changed

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9