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

stredwic lon-capa-cvs@mail.lon-capa.org
Wed, 03 Jul 2002 14:11:14 -0000


stredwic		Wed Jul  3 10:11:14 2002 EDT

  Modified files:              
    /loncom/interface	lonchart.pm 
  Log:
  See bug 218.  I changed the alignment of the column checkboxes to left
  justified.  The look is consistent, whereas the center wasn't always the
  same above the column.  I also added a note above the data specifing how
  to remove columns.  Lastly, the date stamp on the top of the page is
  the time of download of data.  If there is no cached time stamp, the
  current local time is used.
  
  
Index: loncom/interface/lonchart.pm
diff -u loncom/interface/lonchart.pm:1.53 loncom/interface/lonchart.pm:1.54
--- loncom/interface/lonchart.pm:1.53	Tue Jul  2 18:06:53 2002
+++ loncom/interface/lonchart.pm	Wed Jul  3 10:11:14 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # (Publication Handler
 #
-# $Id: lonchart.pm,v 1.53 2002/07/02 22:06:53 stredwic Exp $
+# $Id: lonchart.pm,v 1.54 2002/07/03 14:11:14 stredwic Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -258,7 +258,7 @@
         $Str .= '</pre></td>';
     }
 
-    $Str .= '<td>Total Solved/Total Problems</td>';
+    $Str .= '<td><pre>Total Solved/Total Problems</pre></td>';
     $Str .= '</tr></tbody></table>';
 
     return $Str;
@@ -307,16 +307,19 @@
 
     my $found=0;
     my ($name, $length, $position);
-    my $present='<table border="0" cellpadding="0" cellspacing="0">';
-    $present .= '</tbody><tr>';
+
+    my $present='<pre><b>Note: Uncheck the boxes above a column to ';
+    $present .= 'remove that column from the display.</b></pre>'."\n";
+
+    $present .= '<table border="0" cellpadding="0" cellspacing="0">';
+    $present .= '<tbody><tr>';
     for(my $index=0; $index<(scalar @$headings); $index++) {
         if(!&ShouldShowColumn($CacheData, 'heading'.$index)) {
             next;
         }
-        $present .= '<td align="center">';
-        $name = $headings->[$index];
+        $present .= '<td align="left">';
         $present .= '<input type="checkbox" checked="on" ';
-        $present .= 'name="heading'.$index.'">';
+        $present .= 'name="heading'.$index.'" />';
         $present .= '</td>';
         $found++;
     }
@@ -325,21 +328,18 @@
         if(!&ShouldShowColumn($CacheData, 'sequence'.$sequence)) {
             next;
         }
-        $present .= '<td align="center">';
-        $name = $CacheData->{$sequence.':title'};
+        $present .= '<td align="left">';
         $present .= '<input type="checkbox" checked="on" ';
-        $present .= 'name="sequence'.$sequence.'">';
+        $present .= 'name="sequence'.$sequence.'" />';
         $present .= '</td>';
         $found++;
     }
 
-    if($found) {
-        $present  = $present;
-    } else {
-        $present = '<td></td>';
+    if(!$found) {
+        $present = '';
     }
 
-    return $present.'</tr></form>'."\n";;
+    return $present.'<td></td></tr></form>'."\n";;
 }
 
 sub CreateForm {
@@ -407,7 +407,6 @@
     $Str .= '<script>window.focus();</script>';
     $Str .= '<img align=right src=/adm/lonIcons/lonlogos.gif>';
     $Str .= '<h1>Assessment Chart</h1>';
-    $Str .= '<h3>'.localtime().'</h3>';
     $Str .= '<h1>'.$ENV{'course.'.$ENV{'request.course.id'}.'.description'};
     $Str .= '</h1>';
 
@@ -769,6 +768,8 @@
                                     $name,$courseID,$c);
         }
 
+        # Time of download
+        $CacheData{'time'}=localtime();
 	untie(%CacheData);
     }
 
@@ -1104,6 +1105,10 @@
     # Sort students and print out table desciptive data
     if(tie(%CacheData,'GDBM_File',$ChartDB,&GDBM_READER,0640)) {
         if(!$c->aborted()) { @students=&SortStudents(\@students,\%CacheData); }
+        my $downloadTime=0;
+        if(defined($CacheData{'time'})) { $downloadTime=$CacheData{'time'}; }
+        else { $downloadTime=localtime(); }
+        if(!$c->aborted()) { $r->print('<h3>'.$downloadTime.'</h3>'); }
         if(!$c->aborted()) { $r->print('<h1>'.(scalar @students).
                                        ' students</h1>'); }
 	if(!$c->aborted()) { $r->rflush(); }