Log Message:
-----------
Added code to handle the case where the professor's answer is in
expondential notation using a little e instead of a big one. (Perl
will convert .0000001 to 1E-07, for example, before it is passed to
num_cmp.)
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.9
retrieving revision 1.10
diff -Llib/Parser/Legacy/PGanswermacros.pl -Llib/Parser/Legacy/PGanswermacros.pl -u -r1.9 -r1.10
--- lib/Parser/Legacy/PGanswermacros.pl
+++ lib/Parser/Legacy/PGanswermacros.pl
@@ -1041,6 +1041,13 @@
my %options = (debug => $num_params{debug});
#
+ # Hack to fix up exponential notation in correct answer
+ # (e.g., perl will pass .0000001 as 1e-07).
+ #
+ $correctAnswer = Value::Real->new($correctAnswer)->string
+ if $correctAnswer =~ m/e/ && Value::isNumber($correctAnswer);
+
+ #
# Get an apppropriate context based on the mode
#
my $context;
|