From: dpvc v. a. <we...@ma...> - 2008-06-14 12:03:23
|
Log Message: ----------- Make sure the previous answer is of the same MathObject class as the object being checked (so the comparison is done by the right object). This came up with the ImplicitEquation object). Modified Files: -------------- pg/lib/Value: AnswerChecker.pm Revision Data ------------- Index: AnswerChecker.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Value/AnswerChecker.pm,v retrieving revision 1.116 retrieving revision 1.117 diff -Llib/Value/AnswerChecker.pm -Llib/Value/AnswerChecker.pm -u -r1.116 -r1.117 --- lib/Value/AnswerChecker.pm +++ lib/Value/AnswerChecker.pm @@ -1647,7 +1647,8 @@ return $ans if $ans->{ans_message}; # don't overwrite other messages $ans->{prev_formula} = Parser::Formula($self->{context},$ans->{prev_ans}); if (defined($ans->{prev_formula}) && defined($ans->{student_formula})) { - $ans->{prev_equals_current} = Value::cmp_compare($ans->{student_formula},$ans->{prev_formula},{}); + my $prev = eval {$self->promote($ans->{prev_formula})}; break unless defined($prev); + $ans->{prev_equals_current} = Value::cmp_compare($prev,$ans->{student_formula},{}); if ( !$ans->{isPreview} # not preview mode and $ans->{prev_equals_current} # equivalent and $ans->{prev_ans} ne $ans->{original_student_ans}) # but not identical |