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

sakharuk lon-capa-cvs@mail.lon-capa.org
Thu, 26 Feb 2004 21:13:54 -0000


sakharuk		Thu Feb 26 16:13:54 2004 EDT

  Modified files:              
    /loncom/homework/caparesponse	caparesponse.pm 
  Log:
  Bug 2759 (Format of correct answer not followed in exam mode printing) is fixed for sure and probably bug 2765(numericalresponse sometimes still creates incorrect width tables) is fixed either. But I need to make more checks for the last one.
  
  
Index: loncom/homework/caparesponse/caparesponse.pm
diff -u loncom/homework/caparesponse/caparesponse.pm:1.135 loncom/homework/caparesponse/caparesponse.pm:1.136
--- loncom/homework/caparesponse/caparesponse.pm:1.135	Thu Feb 26 11:36:48 2004
+++ loncom/homework/caparesponse/caparesponse.pm	Thu Feb 26 16:13:54 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # caparesponse definition
 #
-# $Id: caparesponse.pm,v 1.135 2004/02/26 16:36:48 sakharuk Exp $
+# $Id: caparesponse.pm,v 1.136 2004/02/26 21:13:54 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -410,6 +410,7 @@
 	push @table_range,($number_of_bubbles % $bubbles_per_line);
     }
     $cell_width-=8;
+    $cell_width=$cell_width*3/4;
     return ($cell_width,$number_of_tables,@table_range);
 }
 
@@ -460,8 +461,8 @@
 	    &Apache::lonxml::debug("Answer was :$answer: returning :".$#bubble_values.": whih are :".join(':',@bubble_values));
 	    &Math::Random::random_set_seed(@oldseed);
 	    if (defined($format) && $format ne '') {
-		foreach my $value (@bubble_values) {
-		    $value=&format_number($value,$format,$target);
+		for(my $i=0;$i<=$#bubble_values;$i++) {
+		    $bubble_values[$i]=&format_number($bubble_values[$i],$format,$target);
 		}
 	    }
 	    return @bubble_values;