--- loncom/interface/Attic/lonchart.pm 2002/07/02 21:34:40 1.51 +++ loncom/interface/Attic/lonchart.pm 2002/07/03 14:11:14 1.54 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # (Publication Handler # -# $Id: lonchart.pm,v 1.51 2002/07/02 21:34:40 stredwic Exp $ +# $Id: lonchart.pm,v 1.54 2002/07/03 14:11:14 stredwic Exp $ # # Copyright Michigan State University Board of Trustees # @@ -223,13 +223,14 @@ sub FormatStudentData { sub CreateTableHeadings { my ($CacheData,$studentInformation,$headings,$spacePadding)=@_; - my $Str='
';
+    my $Str='';
 
     for(my $index=0; $index<(scalar @$headings); $index++) {
         if(!&ShouldShowColumn($CacheData, 'heading'.$index)) {
             next;
         }
 
+        $Str .= '
';
 	my $data=$$headings[$index];
 	$Str .= $data;
 
@@ -238,6 +239,7 @@ sub CreateTableHeadings {
 	$Str .= (' 'x($CacheData->{$$studentInformation[$index].'Length'}-
                       $length));
 	$Str .= $spacePadding;
+        $Str .= '
'; } foreach my $sequence (split(/\:/,$CacheData->{'orderedSequences'})) { @@ -245,6 +247,7 @@ sub CreateTableHeadings { next; } + $Str .= '
';
         my $name = $CacheData->{$sequence.':title'};
 	$Str .= $name;
 	my @titleLength=split(//,$CacheData->{$sequence.':title'});
@@ -252,10 +255,11 @@ sub CreateTableHeadings {
                      (scalar @titleLength);
 	$Str .= (' 'x$leftover);
 	$Str .= $spacePadding;
+        $Str .= '
'; } - $Str .= 'Total Solved/Total Problems'; - $Str .= '
'; + $Str .= '
Total Solved/Total Problems
'; + $Str .= ''; return $Str; } @@ -303,20 +307,20 @@ sub CreateColumnSelectors { my $found=0; my ($name, $length, $position); - my $present='
';
+
+    my $present='
Note: Uncheck the boxes above a column to ';
+    $present .= 'remove that column from the display.
'."\n"; + + $present .= ''; + $present .= ''; for(my $index=0; $index<(scalar @$headings); $index++) { if(!&ShouldShowColumn($CacheData, 'heading'.$index)) { next; } - $name = $headings->[$index]; - $length=$CacheData->{$$studentInformation[$index].'Length'}; - $position=int($length/2); - $present .= (' 'x($position)); + $present .= ''; $found++; } @@ -324,26 +328,18 @@ sub CreateColumnSelectors { if(!&ShouldShowColumn($CacheData, 'sequence'.$sequence)) { next; } - $name = $CacheData->{$sequence.':title'}; - $length=$CacheData->{$sequence.':columnWidth'}; - $position=int($length/2); - $present .= (' 'x($position)); + $present .= ''; $found++; } - if($found) { - $present .= ''; - $present = $present; - } else { + if(!$found) { $present = ''; } - return $present.''."\n";; + return $present.''."\n";; } sub CreateForm { @@ -410,8 +406,7 @@ sub StartDocument { $Str .= ''; $Str .= ''; $Str .= ''; - $Str .= '

Assessment Chart'.(' 'x8).localtime();
-    $Str .= '

'; + $Str .= '

Assessment Chart

'; $Str .= '

'.$ENV{'course.'.$ENV{'request.course.id'}.'.description'}; $Str .= '

'; @@ -773,6 +768,8 @@ sub ProcessClassList { $name,$courseID,$c); } + # Time of download + $CacheData{'time'}=localtime(); untie(%CacheData); } @@ -1108,6 +1105,10 @@ sub BuildChart { # 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('

'.$downloadTime.'

'); } if(!$c->aborted()) { $r->print('

'.(scalar @students). ' students

'); } if(!$c->aborted()) { $r->rflush(); }
'; $present .= ''; - $position+=2; - $present .= (' 'x($length-$position)); - $present .= $spacePadding; + $present .= 'name="heading'.$index.'" />'; + $present .= ''; $present .= ''; - $position+=2; - $present .= (' 'x($length-$position)); - $present .= $spacePadding; + $present .= 'name="sequence'.$sequence.'" />'; + $present .= '