Diff for /loncom/interface/Attic/lonchart.pm between versions 1.25 and 1.29

version 1.25, 2001/12/18 22:22:13 version 1.29, 2002/02/06 16:59:50
Line 33 Line 33
 # (Page Handler  # (Page Handler
 #  #
 # (TeX Content Handler  # (TeX Content Handler
 #  # YEAR=2000
 # 05/29/00,05/30 Gerd Kortemeyer)  # 05/29/00,05/30 Gerd Kortemeyer)
 # 08/30,08/31,09/06,09/14,09/15,09/16,09/19,09/20,09/21,09/23,  # 08/30,08/31,09/06,09/14,09/15,09/16,09/19,09/20,09/21,09/23,
 # 10/02,10/10,10/14,10/16,10/18,10/19,10/31,11/6,11/14,11/16 Gerd Kortemeyer)  # 10/02,10/10,10/14,10/16,10/18,10/19,10/31,11/6,11/14,11/16 Gerd Kortemeyer)
 #  # YEAR=2001
 # 3/1/1,6/1,17/1,29/1,30/1,31/1 Gerd Kortemeyer)  # 3/1/1,6/1,17/1,29/1,30/1,31/1 Gerd Kortemeyer)
 # 7/10/01 Behrouz Minaei  # 7/10/01 Behrouz Minaei
 # 9/8 Gerd Kortemeyer  # 9/8 Gerd Kortemeyer
 # 10/18/01, 10/19/01 Behrouz Minaei  # 10/1, 10/19, 11/17, 11/22, 11/24, 11/28 12/18 Behrouz Minaei
 # 11/17/01, 11/22/01, 11/24/01, 11/28/01 Behrouz Minaei  # YEAR=2002
 # 12/18/01 Behrouz Minaei  # 2/1 Behrouz Minaei
   #
   ###
   
 package Apache::lonchart;  package Apache::lonchart;
   
 use strict;  use strict;
 use Apache::Constants qw(:common :http);  use Apache::Constants qw(:common :http);
 use Apache::lonnet();  use Apache::lonnet();
   use Apache::loncommon();
 use HTML::TokeParser;  use HTML::TokeParser;
 use GDBM_File;  use GDBM_File;
   
Line 74  sub ExtractStudentData { Line 77  sub ExtractStudentData {
     my %TempHash;      my %TempHash;
     my $Version;      my $Version;
     my $ProbNo;      my $ProbNo;
     my $PrTotal;      my $ProbSolved;
       my $ProbTotal;
     my $LatestVersion;                           my $LatestVersion;                     
     my $Str=substr($students[$index].      my $Str=substr($students[$index].
             '                                                        ',0,14).' ! '.              '                                                        ',0,14).' ! '.
Line 86  sub ExtractStudentData { Line 90  sub ExtractStudentData {
             $result{$name}=$value;              $result{$name}=$value;
         } split(/\&/,$reply);          } split(/\&/,$reply);
  $ProbNo = 0;   $ProbNo = 0;
  $PrTotal = 0;   $ProbTotal = 0;
           $ProbSolved = 0;
  my $IterationNo = 0;   my $IterationNo = 0;
         foreach $ResId (@cols) {          foreach $ResId (@cols) {
     if ($IterationNo == 0) {$IterationNo++; next;}      if ($IterationNo == 0) {$IterationNo++; next;}
     if (!$ResId) {       if (!$ResId) { 
  my $PrNo = sprintf( "%3d", $ProbNo );   my $PrNo = sprintf( "%3d", $ProbNo );
  $Str .= ' '.'<font color="#007700">'.$PrNo.'</font> ';   $Str .= ' '.'<font color="#007700">'.$PrNo.'</font> ';
  $PrTotal += $ProbNo;   $ProbSolved += $ProbNo;
  $ProbNo=0;   $ProbNo=0;
  next;    next; 
     }      }
Line 154  sub ExtractStudentData { Line 159  sub ExtractStudentData {
                     }                      }
     elsif ( $Code eq '+' ) {$ProbNo++;}      elsif ( $Code eq '+' ) {$ProbNo++;}
     $Str .= $TempHash{"$part.Code"};      $Str .= $TempHash{"$part.Code"};
       if ( $Code ne 'x' ) {$ProbTotal++;}
  }   }
             }                 }   
     else {for(my $n=0; $n<$PartNo; $n++) {$Str.=' ';}}      else {
    for(my $n=0; $n<$PartNo; $n++) {
       $Str.=' ';
       $ProbTotal++;
    }
       }
         }           } 
     }      }
     my $PrTot = sprintf( "%5d", $PrTotal );      my $PrTot = sprintf( "%5d", $ProbTotal );
     $Str .= ' '.'<font color="#000088">'.$PrTot.'</font> ';      my $PrSvd = sprintf( "%5d", $ProbSolved );
       $Str .= ' '.'<font color="#000088">'.$PrSvd.'  /'.$PrTot.'</font> ';
   
     return $Str ;      return $Str ;
 }  }
Line 229  sub handler { Line 241  sub handler {
        } else {         } else {
            $r->content_type('text/html');             $r->content_type('text/html');
        }         }
          &Apache::loncommon::no_cache($r);
        $r->send_http_header;         $r->send_http_header;
        return OK;         return OK;
    }     }
Line 310  sub handler { Line 323  sub handler {
     my $reply=&Apache::lonnet::reply('get:'.$sdom.':'.$sname.      my $reply=&Apache::lonnet::reply('get:'.$sdom.':'.$sname.
                                                      ':environment:lastname&generation&firstname&middlename',                                                       ':environment:lastname&generation&firstname&middlename',
                                                      &Apache::lonnet::homeserver($sname,$sdom));                                                       &Apache::lonnet::homeserver($sname,$sdom));
   
                       #$ssec=(int($ssec)) ? int($ssec) : $ssec;
   
                     $rowlabels[$thisindex]=                      $rowlabels[$thisindex]=
                       sprintf('%3s',$ssec).' '.$reply{$sname}.' ';                        sprintf('%3s',$ssec).' '.$reply{$sname}.' ';
                     my $i=0;                      my $i=0;

Removed from v.1.25  
changed lines
  Added in v.1.29


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