From: dpvc v. a. <we...@ma...> - 2005-08-24 11:43:34
|
Log Message: ----------- Made relative tolerances the default for when the tolType is not one of 'relative' or 'absolute'. Modified Files: -------------- pg/lib/Parser/Legacy: PGanswermacros.pl Revision Data ------------- Index: PGanswermacros.pl =================================================================== RCS file: /webwork/cvs/system/pg/lib/Parser/Legacy/PGanswermacros.pl,v retrieving revision 1.10 retrieving revision 1.11 diff -Llib/Parser/Legacy/PGanswermacros.pl -Llib/Parser/Legacy/PGanswermacros.pl -u -r1.10 -r1.11 --- lib/Parser/Legacy/PGanswermacros.pl +++ lib/Parser/Legacy/PGanswermacros.pl @@ -1044,7 +1044,7 @@ # Hack to fix up exponential notation in correct answer # (e.g., perl will pass .0000001 as 1e-07). # - $correctAnswer = Value::Real->new($correctAnswer)->string + $correctAnswer = uc($correctAnswer) if $correctAnswer =~ m/e/ && Value::isNumber($correctAnswer); # @@ -1086,15 +1086,15 @@ # # Set the tolerances # - if ($num_params{tolType} eq 'relative') { + if ($num_params{tolType} eq 'absolute') { $context->flags->set( - tolerance => .01*$num_params{tolerance}, - tolType => 'relative', + tolerance => $num_params{tolerance}, + tolType => 'absolute', ); } else { $context->flags->set( - tolerance => $num_params{tolerance}, - tolType => 'absolute', + tolerance => .01*$num_params{tolerance}, + tolType => 'relative', ); } $context->flags->set( |