Diff for /loncom/interface/Attic/lonchart.pm between versions 1.45 and 1.46

version 1.45, 2002/06/28 19:34:12 version 1.46, 2002/06/28 21:12:46
Line 55  use Apache::loncommon(); Line 55  use Apache::loncommon();
 use HTML::TokeParser;  use HTML::TokeParser;
 use GDBM_File;  use GDBM_File;
   
 #my $jr;   my $jr; 
 # ----- FORMAT PRINT DATA ----------------------------------------------  # ----- FORMAT PRINT DATA ----------------------------------------------
   
 sub FormatStudentInformation {  sub FormatStudentInformation {
Line 244  sub CreateTableHeadings { Line 244  sub CreateTableHeadings {
     return $Str;      return $Str;
 }  }
   
   sub CreateColumnSelectors {
       my ($CacheData,$studentInformation,$headings,$spacePadding)=@_;
       my $Str='';
   
       $Str .= '<form name="stat" method="post" action="/adm/chart" >'."\n";
       $Str .= '<input type="submit" name="sort" value="Refresh Chart"/>';
       $Str .= '</form>'."\n";
       return $Str;
   
       for(my $index=0; $index<(scalar @$headings); $index++) {
    my $data=$$headings[$index];
    $Str .= $data;
   
    my @dataLength=split(//,$data);
    my $length=scalar @dataLength;
    $Str .= (' 'x($CacheData->{$$studentInformation[$index].'Length'}-
                         $length));
    $Str .= $spacePadding;
       }
   
       foreach my $sequence (split(/\:/,$CacheData->{'orderedSequences'})) {
    $Str .= $CacheData->{$sequence.':title'};
    my @titleLength=split(//,$CacheData->{$sequence.':title'});
    my $leftover=$CacheData->{$sequence.':columnWidth'}-
                        (scalar @titleLength);
    $Str .= (' 'x$leftover);
    $Str .= $spacePadding;
       }
   
       return $Str;
   }
   
 sub CreateForm {  sub CreateForm {
     my $OpSel1='';      my $OpSel1='';
     my $OpSel2='';      my $OpSel2='';
Line 393  sub ProcessTopResourceMap { Line 425  sub ProcessTopResourceMap {
     my ($currentSequence, $currentResourceID, $lastResourceID);      my ($currentSequence, $currentResourceID, $lastResourceID);
   
     $currentResourceID=$hash{'ids_/res/'.$ENV{'request.course.uri'}};      $currentResourceID=$hash{'ids_/res/'.$ENV{'request.course.uri'}};
       push(@currentResource, $currentResourceID);
     $lastResourceID=-1;      $lastResourceID=-1;
     $currentSequence=-1;      $currentSequence=-1;
     my $topLevelSequenceNumber = $currentSequence;      my $topLevelSequenceNumber = $currentSequence;
Line 466  sub ProcessTopResourceMap { Line 499  sub ProcessTopResourceMap {
  if($currentResourceID eq $lastResourceID) {   if($currentResourceID eq $lastResourceID) {
     #pop off last resource of sequence      #pop off last resource of sequence
     $currentResourceID=pop(@currentResource);      $currentResourceID=pop(@currentResource);
     #pop to get last resource in previous sequence  
     $currentResourceID=pop(@currentResource);  
     $lastResourceID=pop(@finishResource);      $lastResourceID=pop(@finishResource);
   
     if(defined($CacheData{$currentSequence.':problems'})) {      if(defined($CacheData{$currentSequence.':problems'})) {
Line 519  sub ProcessTopResourceMap { Line 550  sub ProcessTopResourceMap {
  foreach (split(/\,/,$hash{'to_'.$currentResourceID})) {   foreach (split(/\,/,$hash{'to_'.$currentResourceID})) {
     push(@nextResources, $hash{'goesto_'.$_});      push(@nextResources, $hash{'goesto_'.$_});
  }   }
  pop(@currentResource);  
  push(@currentResource, @nextResources);   push(@currentResource, @nextResources);
  # Set the next resource to be popped(processed)   # Set the next resource to be processed
  $currentResourceID=$currentResource[-1];   $currentResourceID=pop(@currentResource);
     }      }
   
     unless (untie(%hash)) {      unless (untie(%hash)) {
Line 892  sub BuildChart { Line 922  sub BuildChart {
  if(!$c->aborted()) { $r->print('<h3>'.(scalar @students).   if(!$c->aborted()) { $r->print('<h3>'.(scalar @students).
                                        ' students</h3>'); }                                         ' students</h3>'); }
  if(!$c->aborted()) { $r->rflush(); }   if(!$c->aborted()) { $r->rflush(); }
   # if(!$c->aborted()) { $r->print(&CreateColumnSelectors(
   #                                                         \%CacheData,
   #                                                         \@studentInformation, 
   # \@headings, 
   # $spacePadding)); }
  if(!$c->aborted()) { $r->print(&CreateTableHeadings(   if(!$c->aborted()) { $r->print(&CreateTableHeadings(
                                                          \%CacheData,                                                           \%CacheData,
                                                          \@studentInformation,                                                            \@studentInformation, 
Line 938  sub BuildChart { Line 973  sub BuildChart {
   
 sub handler {  sub handler {
     my $r=shift;      my $r=shift;
 #    $jr=$r;      $jr=$r;
     unless(&Apache::lonnet::allowed('vgr',$ENV{'request.course.id'})) {      unless(&Apache::lonnet::allowed('vgr',$ENV{'request.course.id'})) {
  $ENV{'user.error.msg'}=   $ENV{'user.error.msg'}=
         $r->uri.":vgr:0:0:Cannot view grades for complete course";          $r->uri.":vgr:0:0:Cannot view grades for complete course";

Removed from v.1.45  
changed lines
  Added in v.1.46


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