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

matthew lon-capa-cvs@mail.lon-capa.org
Mon, 03 Mar 2003 19:17:51 -0000


matthew		Mon Mar  3 14:17:51 2003 EDT

  Modified files:              
    /loncom/interface	lonstatistics.pm 
  Log:
  Removed 'update all student data' button.  Changed 'Refresh' to 
  "Update Display".  Changed all those idiotic scalar(my @tmp = split(//,$var))
  statements to length($var).
  
  
  
Index: loncom/interface/lonstatistics.pm
diff -u loncom/interface/lonstatistics.pm:1.62 loncom/interface/lonstatistics.pm:1.63
--- loncom/interface/lonstatistics.pm:1.62	Fri Feb 28 16:19:53 2003
+++ loncom/interface/lonstatistics.pm	Mon Mar  3 14:17:51 2003
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonstatistics.pm,v 1.62 2003/02/28 21:19:53 matthew Exp $
+# $Id: lonstatistics.pm,v 1.63 2003/03/03 19:17:51 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -235,8 +235,7 @@
     @StudentDataOrder = qw/fullname username domain id section status/;
     foreach my $field (@StudentDataOrder) {
         $StudentData{$field}->{'title'} = $field;
-        $StudentData{$field}->{'base_width'} = 
-                               scalar (my @Tmp = split(//,$field));
+        $StudentData{$field}->{'base_width'} = length($field);
         $StudentData{$field}->{'width'} = 
                                $StudentData{$field}->{'base_width'};
     }
@@ -251,7 +250,7 @@
             $studenthash->{$field}=$student_data->[$i];
             # Keep track of the width of the fields
             next if (! exists($StudentData{$field}));
-            my $length = scalar(my @Tmp1 = split(//,$student_data->[$i]));
+            my $length = length($student_data->[$i]);
             if ($StudentData{$field}->{'width'} < $length) {
                 $StudentData{$field}->{'width'} = $length; 
             }
@@ -464,12 +463,12 @@
     #
     # Compute column widths
     foreach my $seq (@Sequences) {
-        my $name_length = scalar(my @Tmp1 = split(//,$seq->{'title'}));
+        my $name_length = length($seq->{'title'});
         my $num_parts = $seq->{'num_assess_parts'};
         #
         # The number of columns needed for the summation text: 
         #    " 1/5" = 1+3 columns, " 10/99" = 1+5 columns
-        my $sum_length = 1+1+2*(scalar(my @Tmp2 = split(//,$num_parts)));
+        my $sum_length = 1+1+2*(length($num_parts));
         my $num_col = $num_parts+$sum_length;
         if ($num_col < $name_length) {
             $num_col = $name_length;
@@ -1252,14 +1251,12 @@
     my $Str = '';
 
     $Str .= '<table border="0"><tbody><tr>'."\n";
-    $Str .= '<td></td><td></td>'."\n";
+    $Str .= '<td></td>'."\n";
     $Str .= '<td align="center"><b>Select a Report</b></td>'."\n";
     $Str .= '<td align="center"><b>Student Status</b></td></tr>'."\n";
     $Str .= '<tr>'."\n";
     $Str .= '<td align="center"><input type="submit" name="Refresh" ';
-    $Str .= 'value="Refresh" /></td>'."\n";
-    $Str .= '<td align="center"><input type="submit" name="DownloadAll" ';
-    $Str .= 'value="Update All Student Data" /></td>'."\n";
+    $Str .= 'value="Update Display" /></td>'."\n";
     $Str .= '<td align="center">';
     $Str .= '<select name="reportSelected" onchange="document.';
     $Str .= 'Statistics.submit()">'."\n";