Diff for /loncom/interface/statistics/lonproblemstatistics.pm between versions 1.28 and 1.29

version 1.28, 2002/08/14 21:51:51 version 1.29, 2002/08/15 13:54:13
Line 123  sub InitializeProblemStatistics { Line 123  sub InitializeProblemStatistics {
     my $problemData;      my $problemData;
     if($isNotCached) {      if($isNotCached) {
         ($problemData) = &ExtractStudentData(\%cache, $students);          ($problemData) = &ExtractStudentData(\%cache, $students);
         &CalculateStatistics($problemData, \%cache);          &CalculateStatistics($problemData, \%cache, $courseID);
     }      }
     untie(%cache);      untie(%cache);
   
Line 699  sub SortProblems { Line 699  sub SortProblems {
 }  }
   
 sub CalculateStatistics {  sub CalculateStatistics {
     my ($data, $cache)=@_;      my ($data, $cache, $courseID)=@_;
   
     my @problems = split(':::', $data->{'problemList'});      my @problems = split(':::', $data->{'problemList'});
     foreach(@problems) {      foreach(@problems) {
Line 797  sub CalculateStatistics { Line 797  sub CalculateStatistics {
   
         my $df2 = $upper2Sum - $lower2Sum;          my $df2 = $upper2Sum - $lower2Sum;
         $data->{$_.':discriminationFactor2'} = sprintf("%.2f", $df2);          $data->{$_.':discriminationFactor2'} = sprintf("%.2f", $df2);
   
           my %storestats;
           my ($sequence) = split(':', $_);
           my $Average = ($data->{$_.':studentCount'}) ? 
               $data->{$_.':totalTries'}/$data->{$_.':studentCount'} : 0;
           $storestats{$courseID.'___'.$cache->{$sequence.':source'}.
                           '___timestamp'}=time;
           $storestats{$courseID.'___'.$cache->{$sequence.':source'}.
                           '___stdno'}=$data->{$_.':studentCount'};
           $storestats{$courseID.'___'.$cache->{$sequence.':source'}.
                           '___avetries'}=$Average;
           $storestats{$courseID.'___'.$cache->{$sequence.':source'}.
                           '___difficulty'}=$data->{$_.':degreeOfDifficulty'};
           $cache->{$sequence.':source'} =~ /^(\w+)\/(\w+)/;
           if($data->{$_.':studentCount'}) { 
               &Apache::lonnet::put('resevaldata',\%storestats,$1,$2);
           }
     }      }
   
     return;      return;

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


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