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

matthew lon-capa-cvs@mail.lon-capa.org
Thu, 26 Feb 2004 18:28:33 -0000


matthew		Thu Feb 26 13:28:33 2004 EDT

  Modified files:              
    /loncom/interface/statistics	lonstudentassessment.pm 
  Log:
  Update to fix the columns on html output and to compute them properly when
  there are html entities in the titles of the sequences.
  
  
Index: loncom/interface/statistics/lonstudentassessment.pm
diff -u loncom/interface/statistics/lonstudentassessment.pm:1.93 loncom/interface/statistics/lonstudentassessment.pm:1.94
--- loncom/interface/statistics/lonstudentassessment.pm:1.93	Fri Feb 20 11:38:49 2004
+++ loncom/interface/statistics/lonstudentassessment.pm	Thu Feb 26 13:28:33 2004
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonstudentassessment.pm,v 1.93 2004/02/20 16:38:49 matthew Exp $
+# $Id: lonstudentassessment.pm,v 1.94 2004/02/26 18:28:33 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -643,6 +643,7 @@
             # Use 3 digits for the total
             $sequence->{'width_sum'}+=3;
         }
+	#
         if ($chosen_output->{'every_problem'}) {
             # one problem per digit
             $sequence->{'width_problem'} = $sequence->{'num_assess_parts'};
@@ -651,10 +652,8 @@
         }
         $sequence->{'width_total'} = $sequence->{'width_problem'} + 
                                      $sequence->{'width_sum'};
-        if ($sequence->{'width_total'} < length($sequence->{'title'})) {
-            $sequence->{'width_total'} = length($sequence->{'title'});
-            $sequence->{'width_problem'} = 
-                $sequence->{'width_total'} - $sequence->{'width_sum'};
+        if ($sequence->{'width_total'} < length(&HTML::Entities::decode($sequence->{'title'}))) {
+            $sequence->{'width_total'} = length(&HTML::Entities::decode($sequence->{'title'}));
         }
         #
         # Output the sequence titles
@@ -728,8 +727,9 @@
         #
         if (! $chosen_output->{'every_problem'}) {
             $performance = '';
+	    $performance_length=0;
         }
-        $performance .= ' 'x($seq->{'width_problem'}-$performance_length).
+        $performance .= ' 'x($seq->{'width_total'}-$performance_length-$seq->{'width_sum'}).
             $ratio;
         #
         $Str .= $performance.$padding;