I have tried "withPostFilter" but I don't understand the syntax well enough, or even if it could work with my answer checker.
Thanks for your time.
withPostFilter
, but it is probably easier to trap the error in the line that is causing it. So you could replace
if ($studentH != $y[$i]) {Value->Error("c[$i] term not right")}with
my $result = Parser::Eval(sub {$studentH == $y[$i] ? 1 : 0}); Value->Error("Can't check equality") unless defined($result); Value->Error("c[$i] term not right") unless result;(using whatever message you want).
Note that you will need to do something similar a few lines later with the ($studentwp != $yforced
check.
Value->Error
construction does not grade the problem, but the latter construction does?Value->Error()
doesn't set the score, but the MathObject answer checker explicitly sets the score to 0 prior to calling your checker, so there is no need for you to return a value if you want to score to be 0 when you produce the error. Just calling Value->Error()
is perfectly fine, and in fact is how all the MathObject answer checkers report errors. So if there were a problem with this, it would have been apparent long ago.