[LON-CAPA-cvs] cvs: loncom /homework/caparesponse caparesponse.pm
sakharuk
lon-capa-cvs@mail.lon-capa.org
Tue, 25 Nov 2003 14:37:11 -0000
sakharuk Tue Nov 25 09:37:11 2003 EDT
Modified files:
/loncom/homework/caparesponse caparesponse.pm
Log:
Fixed the problem of printing numbers with two or more digits in the power for exam mode.
Index: loncom/homework/caparesponse/caparesponse.pm
diff -u loncom/homework/caparesponse/caparesponse.pm:1.123 loncom/homework/caparesponse/caparesponse.pm:1.124
--- loncom/homework/caparesponse/caparesponse.pm:1.123 Fri Nov 21 14:15:12 2003
+++ loncom/homework/caparesponse/caparesponse.pm Tue Nov 25 09:37:11 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# caparesponse definition
#
-# $Id: caparesponse.pm,v 1.123 2003/11/21 19:15:12 albertel Exp $
+# $Id: caparesponse.pm,v 1.124 2003/11/25 14:37:11 sakharuk Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -410,8 +410,8 @@
my $number = $1;
my $power = $2;
$power=~s/^\+//;
- $power=~s/^(-?)0+(\d+)//;
- $ans=$number.'$\times 10^{'.$1.$2.'}$'; #'stupidemacs
+ $power=~s/^(-?)0+(\d+)/$1$2/;
+ $ans=$number.'$\times 10^{'.$power.'}$'; #'stupidemacs
}
}
return $ans;