[system] / trunk / pg / lib / Value / AnswerChecker.pm Repository:
ViewVC logotype

Diff of /trunk/pg/lib/Value/AnswerChecker.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 5691 Revision 5692
1645 my $self = shift; my $ans = shift; 1645 my $self = shift; my $ans = shift;
1646 $ans->{_filter_name} = "produce_equivalence_message"; 1646 $ans->{_filter_name} = "produce_equivalence_message";
1647 return $ans if $ans->{ans_message}; # don't overwrite other messages 1647 return $ans if $ans->{ans_message}; # don't overwrite other messages
1648 $ans->{prev_formula} = Parser::Formula($self->{context},$ans->{prev_ans}); 1648 $ans->{prev_formula} = Parser::Formula($self->{context},$ans->{prev_ans});
1649 if (defined($ans->{prev_formula}) && defined($ans->{student_formula})) { 1649 if (defined($ans->{prev_formula}) && defined($ans->{student_formula})) {
1650 my $prev = eval {$self->promote($ans->{prev_formula})}; break unless defined($prev);
1650 $ans->{prev_equals_current} = Value::cmp_compare($ans->{student_formula},$ans->{prev_formula},{}); 1651 $ans->{prev_equals_current} = Value::cmp_compare($prev,$ans->{student_formula},{});
1651 if ( !$ans->{isPreview} # not preview mode 1652 if ( !$ans->{isPreview} # not preview mode
1652 and $ans->{prev_equals_current} # equivalent 1653 and $ans->{prev_equals_current} # equivalent
1653 and $ans->{prev_ans} ne $ans->{original_student_ans}) # but not identical 1654 and $ans->{prev_ans} ne $ans->{original_student_ans}) # but not identical
1654 {$ans->{ans_message} = "This answer is equivalent to the one you just submitted."} 1655 {$ans->{ans_message} = "This answer is equivalent to the one you just submitted."}
1655 } 1656 }

Legend:
Removed from v.5691  
changed lines
  Added in v.5692

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9