From: dpvc v. a. <we...@ma...> - 2010-01-27 13:03:45
|
Log Message: ----------- Allow error for correct answer but not student answer in getTypicalValue 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.127 retrieving revision 1.128 diff -Llib/Value/AnswerChecker.pm -Llib/Value/AnswerChecker.pm -u -r1.127 -r1.128 --- lib/Value/AnswerChecker.pm +++ lib/Value/AnswerChecker.pm @@ -1580,7 +1580,7 @@ my $self = shift; my $other = shift; my $ans = shift; return 1 if $self->type eq $other->type; my $typeMatch = $self->getTypicalValue($self); - $other = $self->getTypicalValue($other) if Value::isFormula($other); + $other = $self->getTypicalValue($other,1) if Value::isFormula($other); return 1 unless defined($other); # can't really tell, so don't report type mismatch return 1 if $typeMatch->classMatch('String') && Value::isFormula($ans->{typeMatch}); # avoid infinite loop $typeMatch->typeMatch($other,$ans); @@ -1590,11 +1590,11 @@ # Create a value from the formula (so we know the output type) # sub getTypicalValue { - my $self = shift; my $f = shift; + my $self = shift; my $f = shift; my $noError = shift; return $f->{test_values}[0] if $f->{test_values}; my $points = $f->{test_points} || $self->{test_points}; return ($f->createPointValues($points)||[])->[0] if $points; - return ((($f->createRandomPoints(1,undef,1))[1])||[])->[0]; + return ((($f->createRandomPoints(1,undef,$noError))[1])||[])->[0]; } # |