[LON-CAPA-cvs] cvs: loncom /interface/statistics lonstudentassessment.pm

matthew lon-capa-cvs@mail.lon-capa.org
Wed, 31 Mar 2004 19:34:10 -0000


matthew		Wed Mar 31 14:34:10 2004 EDT

  Modified files:              
    /loncom/interface/statistics	lonstudentassessment.pm 
  Log:
  Fixed bug with truncating sums in chart instead of rounding them.
  Added a space between the problem scores output and the sum for a 
  sequence.
  
  
Index: loncom/interface/statistics/lonstudentassessment.pm
diff -u loncom/interface/statistics/lonstudentassessment.pm:1.98 loncom/interface/statistics/lonstudentassessment.pm:1.99
--- loncom/interface/statistics/lonstudentassessment.pm:1.98	Wed Mar 10 13:50:38 2004
+++ loncom/interface/statistics/lonstudentassessment.pm	Wed Mar 31 14:34:10 2004
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonstudentassessment.pm,v 1.98 2004/03/10 18:50:38 matthew Exp $
+# $Id: lonstudentassessment.pm,v 1.99 2004/03/31 19:34:10 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -632,8 +632,12 @@
         # Comptue column widths
         $sequence->{'width_sum'} = 0;
         if ($chosen_output->{'sequence_sum'}) {
+            if ($chosen_output->{'every_problem'}) {
+                # Use 1 digit for a space
+                $sequence->{'width_sum'} += 1;            
+            }
             # Use 3 digits for the sum
-            $sequence->{'width_sum'} = 3;
+            $sequence->{'width_sum'} += 3;
         }
         if ($chosen_output->{'sequence_max'}) {
             if ($sequence->{'width_sum'}>0) {
@@ -715,8 +719,11 @@
                                               $seq,$show_links);
         }
         my $ratio='';
+        if ($chosen_output->{'every_problem'}) {
+            $ratio .= ' ';
+        }
         if ($chosen_output->{'sequence_sum'} && $score ne ' ') {
-            $ratio .= sprintf("%3d",$score);
+            $ratio .= sprintf("%3.0f",$score);
         } elsif($chosen_output->{'sequence_sum'}) {
             $ratio .= ' 'x3;
         }
@@ -724,7 +731,7 @@
             if ($chosen_output->{'sequence_sum'}) {
                 $ratio .= '/';
             }
-            $ratio .= sprintf("%3d",$seq_max);
+            $ratio .= sprintf("%3.0f",$seq_max);
         }
         #
         if (! $chosen_output->{'every_problem'}) {