Here is a minimal answer evaluator which always gives a score of 10% -- no matter what answer is entered. # Load whatever macros you need for the problem loadMacros("PG.pl", "PGbasicmacros.pl", "PGanswermacros.pl", );
$showPartialCorrectAnswers = 1; TEXT(beginproblem());
my $ans_eval = new AnswerEvaluator(); $ans_eval->install_post_filter( sub {my $rh_ans = shift; $rh_ans->{correct_ans} = 'foo'; $rh_ans->{score}=0.1; $rh_ans;} );
BEGIN_TEXT Enter a value for \(pi\) \{ans_rule()\} END_TEXT ANS($ans_eval);
ENDDOCUMENT();
The response from WeBWorK is ANSWERS ONLY CHECKED -- ANSWERS NOT RECORDED
Entered Answer Preview Correct Result 90 foo 10% correct
The answer above is NOT completely correct.
which seems to be pretty close to what you are looking for.
Take care,
Mike
<| Post or View Comments |>
|