From: dpvc v. a. <we...@ma...> - 2008-09-11 17:30:55
|
Log Message: ----------- Fixed a problem where if two FormulaUpToConstant objects were used in the same problem, the second would always be marked as incorrect. (Subtle interplay of variable names in the safe compartment.) Modified Files: -------------- pg/macros: parserFormulaUpToConstant.pl Revision Data ------------- Index: parserFormulaUpToConstant.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/parserFormulaUpToConstant.pl,v retrieving revision 1.11 retrieving revision 1.12 diff -Lmacros/parserFormulaUpToConstant.pl -Lmacros/parserFormulaUpToConstant.pl -u -r1.11 -r1.12 --- macros/parserFormulaUpToConstant.pl +++ macros/parserFormulaUpToConstant.pl @@ -175,9 +175,9 @@ # # Compare with adaptive parameters to see if $l + n0 C = $r for some n0. # - $main::_cmp_ = sub {return $l->{adapt} == $r}; # a closure to access local variables - my $equal = main::PG_restricted_eval('&$_cmp_'); # prevents errors with large adaptive parameters - delete $main::{_cmp_}; # remove temprary function + $main::{_cmp_} = sub {return $l->{adapt} == $r}; # a closure to access local variables + my $equal = main::PG_restricted_eval('&{$main::{_cmp_}}'); # prevents errors with large adaptive parameters + delete $main::{_cmp_}; # remove temprary function return -1 unless $equal; # # Check that n0 is non-zero (i.e., there is a multiple of C in the student answer) |