From: dpvc v. a. <we...@ma...> - 2005-08-01 12:40:20
|
Log Message: ----------- Added postfilter to Parser-based implementation of NUM_CMP so that the student's answer is updated to be the result of evaluating the answer (when there is no error in evaluating the answer). This correctly reflects the behaviour of the original NUM_CMP. Modified Files: -------------- pg/lib/Parser/Legacy: PGanswermacros.pl Revision Data ------------- Index: PGanswermacros.pl =================================================================== RCS file: /webwork/cvs/system/pg/lib/Parser/Legacy/PGanswermacros.pl,v retrieving revision 1.5 retrieving revision 1.6 diff -Llib/Parser/Legacy/PGanswermacros.pl -Llib/Parser/Legacy/PGanswermacros.pl -u -r1.5 -r1.6 --- lib/Parser/Legacy/PGanswermacros.pl +++ lib/Parser/Legacy/PGanswermacros.pl @@ -1124,6 +1124,12 @@ $rh_ans->{original_correct_ans} = $rh_ans->{correct_ans}; return $rh_ans; }); + $cmp->install_post_filter(sub { + my $rh_ans = shift; + $rh_ans->{student_ans} = $rh_ans->{student_value}->string + if ref($rh_ans->{student_value}); + return $rh_ans; + }); $cmp->{debug} = $num_params{debug}; &$Context($oldContext); |