From: dpvc v. a. <we...@ma...> - 2005-08-13 17:48:30
|
Log Message: ----------- Fixed reduction warnings for individual sets, intervals and unions (in making it work for lists, I broke it for the single items). 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.58 retrieving revision 1.59 diff -Llib/Value/AnswerChecker.pm -Llib/Value/AnswerChecker.pm -u -r1.58 -r1.59 --- lib/Value/AnswerChecker.pm +++ lib/Value/AnswerChecker.pm @@ -818,7 +818,7 @@ sub cmp_compare { my $self = shift; my $student = shift; my $ans = shift; my $error = $self->cmp_checkUnionReduce($student,$ans,@_); - if ($error) {$$Value::context->setError($error,'',undef,undef,$CMP_WARNING); return 0} + if ($error) {$$Value::context->setError($error,'',undef,undef,$CMP_WARNING); return} $self->SUPER::cmp_compare($student,$ans,@_); } @@ -890,7 +890,7 @@ sub cmp_compare { my $self = shift; my $student = shift; my $ans = shift; my $error = $self->cmp_checkUnionReduce($student,$ans,@_); - if ($error) {$$Value::context->setError($error,'',undef,undef,$CMP_WARNING); return 0} + if ($error) {$$Value::context->setError($error,'',undef,undef,$CMP_WARNING); return} $self->SUPER::cmp_compare($student,$ans,@_); } @@ -921,7 +921,12 @@ entry_type => 'an interval or set', )} -sub cmp_equal {Value::List::cmp_equal(@_)} +sub cmp_equal { + my $self = shift; my $ans = shift; + my $error = $self->cmp_checkUnionReduce($ans->{student_value},$ans); + if ($error) {$self->cmp_Error($ans,$error); return} + Value::List::cmp_equal($self,$ans); +} # # Check for unreduced sets and unions @@ -929,7 +934,7 @@ sub cmp_compare { my $self = shift; my $student = shift; my $ans = shift; my $error = $self->cmp_checkUnionReduce($student,$ans,@_); - if ($error) {$$Value::context->setError($error,'',undef,undef,$CMP_WARNING); return 0} + if ($error) {$$Value::context->setError($error,'',undef,undef,$CMP_WARNING); return} $self->SUPER::cmp_compare($student,$ans,@_); } |