[LON-CAPA-cvs] cvs: loncom /homework/caparesponse caparesponse.pm

sakharuk lon-capa-cvs@mail.lon-capa.org
Mon, 22 Sep 2003 18:38:59 -0000


sakharuk		Mon Sep 22 14:38:59 2003 EDT

  Modified files:              
    /loncom/homework/caparesponse	caparesponse.pm 
  Log:
  Corrected part responsible for the determination of the format.
  
  
Index: loncom/homework/caparesponse/caparesponse.pm
diff -u loncom/homework/caparesponse/caparesponse.pm:1.110 loncom/homework/caparesponse/caparesponse.pm:1.111
--- loncom/homework/caparesponse/caparesponse.pm:1.110	Mon Sep 22 09:04:55 2003
+++ loncom/homework/caparesponse/caparesponse.pm	Mon Sep 22 14:38:59 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # caparesponse definition
 #
-# $Id: caparesponse.pm,v 1.110 2003/09/22 13:04:55 sakharuk Exp $
+# $Id: caparesponse.pm,v 1.111 2003/09/22 18:38:59 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -423,7 +423,7 @@
 	my $format = '';
 	#What is the number? (integer,decimal,floating point)
 	if ($number=~/^(\d*\.?\d*)(E|e)(\d*)$/) {
-	    $format = 'e'.$3;
+	    if (abs($3)>=100) {$format = 'e3';} else {$format = 'e2';}
 	} elsif ($number=~/^(\d*)\.(\d*)$/) {
 	    $format = '4f';
 	} elsif ($number=~/^(\d*)$/) {