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

www lon-capa-cvs-allow@mail.lon-capa.org
Tue, 14 Oct 2008 15:16:59 -0000


www		Tue Oct 14 11:16:59 2008 EDT

  Modified files:              
    /loncom/interface/statistics	lonstudentassessment.pm 
  Log:
  Saving my work on fractional score display.
  
  
Index: loncom/interface/statistics/lonstudentassessment.pm
diff -u loncom/interface/statistics/lonstudentassessment.pm:1.150 loncom/interface/statistics/lonstudentassessment.pm:1.151
--- loncom/interface/statistics/lonstudentassessment.pm:1.150	Tue Sep 16 09:10:19 2008
+++ loncom/interface/statistics/lonstudentassessment.pm	Tue Oct 14 11:16:58 2008
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonstudentassessment.pm,v 1.150 2008/09/16 13:10:19 bisitz Exp $
+# $Id: lonstudentassessment.pm,v 1.151 2008/10/14 15:16:58 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -713,8 +713,8 @@
                 $width{$symb}->{'width_sum'} += 1;            
             }
 	    $total_count += &count_parts($navmap,$seq);
-            # Use 3 digits for the sum
-            $width{$symb}->{'width_sum'} += 3;
+            # Use 6 digits for the sum
+            $width{$symb}->{'width_sum'} += 6;
         }
         # Compute width of maximum
         if ($chosen_output->{'sequence_max'}) {
@@ -722,8 +722,8 @@
                 # One digit for the '/'
                 $width{$symb}->{'width_sum'} +=1;
             }
-            # Use 3 digits for the total
-            $width{$symb}->{'width_sum'}+=3;
+            # Use 6 digits for the total
+            $width{$symb}->{'width_sum'}+=6;
         }
 	#
         if ($chosen_output->{'every_problem'}) {
@@ -885,16 +885,17 @@
             $ratio .= ' ';
         }
         if ($chosen_output->{'sequence_sum'} && $score ne ' ') {
-            my $score .= sprintf("%3.0f",$score);
-            $ratio .= (' 'x(3-length($score))).$score;
+            my $score .= sprintf("%3.2f",$score);
+            $ratio .= (' 'x(6-length($score))).$score;
         } elsif($chosen_output->{'sequence_sum'}) {
-            $ratio .= ' 'x3;
+            $ratio .= ' 'x6;
         }
         if ($chosen_output->{'sequence_max'}) {
             if ($chosen_output->{'sequence_sum'}) {
                 $ratio .= '/';
             }
-            $ratio .= sprintf("%3.0f",$seq_max);
+            my $sequence_total=sprintf("%3.2f",$seq_max);
+            $ratio .= $sequence_total.(' 'x(6-length($sequence_total)));
         }
         #
         if (! $chosen_output->{'every_problem'}) {
@@ -928,8 +929,8 @@
     if (! defined($score)) {
         $score = ' ' x $total_sum_width;
     } else {
-        $score = sprintf("%.0f",$score);
-        $score = (' 'x(3-length($score))).$score;
+        $score = sprintf("%.2f",$score);
+        $score = (' 'x(6-length($score))).$score;
     }
     $Str .= ' '.' 'x($total_sum_width-length($score)).$score.' / '.$max;
     $Str .= " \n";