From: Mike G. v. a. <we...@ma...> - 2005-11-12 01:32:56
|
Log Message: ----------- Roll back my changes. Use Davide's method of detecting the preview Button Modified Files: -------------- pg/macros: PGanswermacros.pl Revision Data ------------- Index: PGanswermacros.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/PGanswermacros.pl,v retrieving revision 1.46 retrieving revision 1.47 diff -Lmacros/PGanswermacros.pl -Lmacros/PGanswermacros.pl -u -r1.46 -r1.47 --- macros/PGanswermacros.pl +++ macros/PGanswermacros.pl @@ -2036,18 +2036,16 @@ sub { my $rh_ans = shift; $rh_ans->{_filter_name} = "produce_equivalence_message"; - my $preview_mode_flag = $inputs_ref->{previewAnswers}; - $preview_mode_flag = defined($preview_mode_flag) and $preview_mode_flag; - # no message if no duplication - return $rh_ans unless $rh_ans->{prev_equals_current}; - - if ($preview_mode_flag) { #previews generate warning message always - $rh_ans->{ans_message} = "This answer is equivalent to the one you just submitted or previewed."; - } elsif ($rh_ans->{score} != 1) {# non correct answers generate warning message - $rh_ans->{ans_message} = "This answer is equivalent to the one you just submitted or previewed."; - } else { # correct answers in submit mode don't generate warning messages. - - } + return $rh_ans unless $rh_ans->{prev_equals_current} && + ($rh_ans->{score} != 1 || $rh_ans->{isPreview}); + # + # If the match is exact don't give an error since there may be multiple + # entry blanks and the student is trying to get one of the other ones + # right. We should only give this message when the student is actually + # working on this answer. + # + return $rh_ans if $rh_ans->{prev_ans} eq $rh_ans->{original_student_ans}; + $rh_ans->{ans_message} = "This answer is equivalent to the one you just submitted or previewed."; $rh_ans; } ); |