Diff for /loncom/interface/statistics/lonproblemstatistics.pm between versions 1.36 and 1.38

version 1.36, 2002/11/12 19:52:46 version 1.38, 2002/12/06 21:56:22
Line 222  sub BuildGraphicChart { Line 222  sub BuildGraphicChart {
     my ($graph,$cacheDB,$courseDescription,$students,$courseID,$r,$c)=@_;      my ($graph,$cacheDB,$courseDescription,$students,$courseID,$r,$c)=@_;
     my %cache;      my %cache;
     my $max;      my $max;
     unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) {  
         return 'Unable to tie database.7';  
     }  
   
     my $title = '';      my $title = '';
     if($graph eq 'DoDiffGraph') {      if($graph eq 'DoDiffGraph') {
Line 244  sub BuildGraphicChart { Line 241  sub BuildGraphicChart {
   
     my @values = ();      my @values = ();
   
       unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) {
           return 'Unable to tie database.7';
       }
   
     foreach(@$orderedProblems) {      foreach(@$orderedProblems) {
         my ($sequence,$problem,$part)=split(':', $_);          my ($sequence,$problem,$part)=split(':', $_);
         if($cache{'StatisticsMaps'} ne 'All Maps'  &&          if($cache{'StatisticsMaps'} ne 'All Maps'  &&
Line 299  sub DrawGraph { Line 300  sub DrawGraph {
     #(10 - $Max % 10);      #(10 - $Max % 10);
     } else { $Max = 1; }      } else { $Max = 1; }
   
 #    my @GData = ($courseDescription, 'Problem_number',  
 #                 $title, $Max, $sendCount, $sendValues);  
     my @GData = ('','Problem_number',$title,$Max,$sendCount,$sendValues);      my @GData = ('','Problem_number',$title,$Max,$sendCount,$sendValues);
   
 #    $r->print('</form>'."\n");  #    $r->print('</form>'."\n");
Line 659  sub ExtractStudentData { Line 658  sub ExtractStudentData {
   
 sub SortDivideByTries {  sub SortDivideByTries {
     my ($toSort, $data, $sortOn)=@_;      my ($toSort, $data, $sortOn)=@_;
     my @orderedData = sort { ($data->{$a.':totalTries'}) ?       my @orderedData = sort { ($data->{$a.':totalTries'}) ?
                              ($data->{$a.$sortOn}/$data->{$a.':totalTries'}):0                               ($data->{$a.$sortOn}/$data->{$a.':totalTries'}):0
                              <=>                               <=>
                              ($data->{$b.':totalTries'}) ?                               ($data->{$b.':totalTries'}) ?

Removed from v.1.36  
changed lines
  Added in v.1.38


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