Diff for /loncom/interface/Attic/lonchart.pm between versions 1.52 and 1.54

version 1.52, 2002/07/02 21:48:36 version 1.54, 2002/07/03 14:11:14
Line 223  sub FormatStudentData { Line 223  sub FormatStudentData {
   
 sub CreateTableHeadings {  sub CreateTableHeadings {
     my ($CacheData,$studentInformation,$headings,$spacePadding)=@_;      my ($CacheData,$studentInformation,$headings,$spacePadding)=@_;
     my $Str='<pre>';      my $Str='<tr>';
   
     for(my $index=0; $index<(scalar @$headings); $index++) {      for(my $index=0; $index<(scalar @$headings); $index++) {
         if(!&ShouldShowColumn($CacheData, 'heading'.$index)) {          if(!&ShouldShowColumn($CacheData, 'heading'.$index)) {
             next;              next;
         }          }
   
           $Str .= '<td align="left"><pre>';
  my $data=$$headings[$index];   my $data=$$headings[$index];
  $Str .= $data;   $Str .= $data;
   
Line 238  sub CreateTableHeadings { Line 239  sub CreateTableHeadings {
  $Str .= (' 'x($CacheData->{$$studentInformation[$index].'Length'}-   $Str .= (' 'x($CacheData->{$$studentInformation[$index].'Length'}-
                       $length));                        $length));
  $Str .= $spacePadding;   $Str .= $spacePadding;
           $Str .= '</pre></td>';
     }      }
   
     foreach my $sequence (split(/\:/,$CacheData->{'orderedSequences'})) {      foreach my $sequence (split(/\:/,$CacheData->{'orderedSequences'})) {
Line 245  sub CreateTableHeadings { Line 247  sub CreateTableHeadings {
             next;              next;
         }          }
   
           $Str .= '<td align="left"><pre>';
         my $name = $CacheData->{$sequence.':title'};          my $name = $CacheData->{$sequence.':title'};
  $Str .= $name;   $Str .= $name;
  my @titleLength=split(//,$CacheData->{$sequence.':title'});   my @titleLength=split(//,$CacheData->{$sequence.':title'});
Line 252  sub CreateTableHeadings { Line 255  sub CreateTableHeadings {
                      (scalar @titleLength);                       (scalar @titleLength);
  $Str .= (' 'x$leftover);   $Str .= (' 'x$leftover);
  $Str .= $spacePadding;   $Str .= $spacePadding;
           $Str .= '</pre></td>';
     }      }
   
     $Str .= 'Total Solved/Total Problems';      $Str .= '<td><pre>Total Solved/Total Problems</pre></td>';
     $Str .= '</pre>';      $Str .= '</tr></tbody></table>';
   
     return $Str;      return $Str;
 }  }
Line 303  sub CreateColumnSelectors { Line 307  sub CreateColumnSelectors {
   
     my $found=0;      my $found=0;
     my ($name, $length, $position);      my ($name, $length, $position);
     my $present='<pre>';  
       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++) {      for(my $index=0; $index<(scalar @$headings); $index++) {
         if(!&ShouldShowColumn($CacheData, 'heading'.$index)) {          if(!&ShouldShowColumn($CacheData, 'heading'.$index)) {
             next;              next;
         }          }
         $name = $headings->[$index];          $present .= '<td align="left">';
         $length=$CacheData->{$$studentInformation[$index].'Length'};  
         $position=int($length/2);  
  $present .= (' 'x($position));  
         $present .= '<input type="checkbox" checked="on" ';          $present .= '<input type="checkbox" checked="on" ';
         $present .= 'name="heading'.$index.'">';          $present .= 'name="heading'.$index.'" />';
         $position+=2;          $present .= '</td>';
  $present .= (' 'x($length-$position));  
  $present .= $spacePadding;  
         $found++;          $found++;
     }      }
   
Line 324  sub CreateColumnSelectors { Line 328  sub CreateColumnSelectors {
         if(!&ShouldShowColumn($CacheData, 'sequence'.$sequence)) {          if(!&ShouldShowColumn($CacheData, 'sequence'.$sequence)) {
             next;              next;
         }          }
         $name = $CacheData->{$sequence.':title'};          $present .= '<td align="left">';
         $length=$CacheData->{$sequence.':columnWidth'};  
         $position=int($length/2);  
  $present .= (' 'x($position));  
         $present .= '<input type="checkbox" checked="on" ';          $present .= '<input type="checkbox" checked="on" ';
         $present .= 'name="sequence'.$sequence.'">';          $present .= 'name="sequence'.$sequence.'" />';
         $position+=2;          $present .= '</td>';
  $present .= (' 'x($length-$position));  
  $present .= $spacePadding;  
         $found++;          $found++;
     }      }
   
     if($found) {      if(!$found) {
         $present .= '</pre>';  
         $present  = $present;  
     } else {  
         $present = '';          $present = '';
     }      }
   
     return $present.'</form>'."\n";;      return $present.'<td></td></tr></form>'."\n";;
 }  }
   
 sub CreateForm {  sub CreateForm {
Line 411  sub StartDocument { Line 407  sub StartDocument {
     $Str .= '<script>window.focus();</script>';      $Str .= '<script>window.focus();</script>';
     $Str .= '<img align=right src=/adm/lonIcons/lonlogos.gif>';      $Str .= '<img align=right src=/adm/lonIcons/lonlogos.gif>';
     $Str .= '<h1>Assessment Chart</h1>';      $Str .= '<h1>Assessment Chart</h1>';
     $Str .= '<h3>'.localtime().'</h3>';  
     $Str .= '<h1>'.$ENV{'course.'.$ENV{'request.course.id'}.'.description'};      $Str .= '<h1>'.$ENV{'course.'.$ENV{'request.course.id'}.'.description'};
     $Str .= '</h1>';      $Str .= '</h1>';
   
Line 773  sub ProcessClassList { Line 768  sub ProcessClassList {
                                     $name,$courseID,$c);                                      $name,$courseID,$c);
         }          }
   
           # Time of download
           $CacheData{'time'}=localtime();
  untie(%CacheData);   untie(%CacheData);
     }      }
   
Line 1108  sub BuildChart { Line 1105  sub BuildChart {
     # Sort students and print out table desciptive data      # Sort students and print out table desciptive data
     if(tie(%CacheData,'GDBM_File',$ChartDB,&GDBM_READER,0640)) {      if(tie(%CacheData,'GDBM_File',$ChartDB,&GDBM_READER,0640)) {
         if(!$c->aborted()) { @students=&SortStudents(\@students,\%CacheData); }          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).          if(!$c->aborted()) { $r->print('<h1>'.(scalar @students).
                                        ' students</h1>'); }                                         ' students</h1>'); }
  if(!$c->aborted()) { $r->rflush(); }   if(!$c->aborted()) { $r->rflush(); }

Removed from v.1.52  
changed lines
  Added in v.1.54


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>