Diff for /loncom/interface/lonstatistics.pm between versions 1.37 and 1.38

version 1.37, 2002/07/30 21:31:48 version 1.38, 2002/08/01 20:49:06
Line 83  sub ProcessFormData{ Line 83  sub ProcessFormData{
     &CheckFormElement($cache, 'sort', 'sort', 'fullname');      &CheckFormElement($cache, 'sort', 'sort', 'fullname');
     &CheckFormElement($cache, 'download', 'download', 'false');      &CheckFormElement($cache, 'download', 'download', 'false');
   
       # student assessment
     if(defined($ENV{'form.CreateStudentAssessment'}) ||      if(defined($ENV{'form.CreateStudentAssessment'}) ||
        defined($ENV{'form.NextStudent'}) ||         defined($ENV{'form.NextStudent'}) ||
        defined($ENV{'form.PreviousStudent'})) {         defined($ENV{'form.PreviousStudent'})) {
Line 110  sub ProcessFormData{ Line 111  sub ProcessFormData{
         $cache->{'sectionsSelected'} = $cache->{'sectionList'};          $cache->{'sectionsSelected'} = $cache->{'sectionList'};
     }      }
   
       # Problem analysis
       &CheckFormElement($cache, 'Interval', 'Interval', '1');
   
       # ProblemStatistcs
       &CheckFormElement($cache, 'DisplayCSVFormat',
                         'DisplayFormat', 'Display Table Format');
       &CheckFormElement($cache, 'ProblemStatisticsAscend',
                         'ProblemStatisticsAscend', 'Ascending');
       &CheckFormElement($cache, 'ProblemStatisticsMaps', 
                         'ProblemStatisticsMaps', 'All Maps');
   
       # Search only form elements
     my @headingColumns=();      my @headingColumns=();
     my @sequenceColumns=();      my @sequenceColumns=();
     my $foundColumn = 0;      my $foundColumn = 0;
Line 131  sub ProcessFormData{ Line 144  sub ProcessFormData{
     $cache->{'reportKey'} = 'false';      $cache->{'reportKey'} = 'false';
     if($cache->{'reportSelected'} eq 'Analyze') {      if($cache->{'reportSelected'} eq 'Analyze') {
         $cache->{'reportKey'} = 'Analyze';          $cache->{'reportKey'} = 'Analyze';
       } elsif($cache->{'reportSelected'} eq 'DoDiffGraph') {
           $cache->{'reportKey'} = 'DoDiffGraph';
       } elsif($cache->{'reportSelected'} eq 'PercentWrongGraph') {
           $cache->{'reportKey'} = 'PercentWrongGraph';
       }
   
       if(defined($ENV{'form.DoDiffGraph'})) {
           $cache->{'reportSelected'} = 'DoDiffGraph';
           $cache->{'reportKey'} = 'DoDiffGraph';
       } elsif(defined($ENV{'form.PercentWrongGraph'})) {
           $cache->{'reportSelected'} = 'PercentWrongGraph';
           $cache->{'reportKey'} = 'PercentWrongGraph';
     }      }
   
     foreach (keys(%ENV)) {      foreach (keys(%ENV)) {
Line 140  sub ProcessFormData{ Line 165  sub ProcessFormData{
             my $data;              my $data;
             (undef, $data)=split(':::', $_);              (undef, $data)=split(':::', $_);
             $cache->{'AnalyzeInfo'}=$data;              $cache->{'AnalyzeInfo'}=$data;
               
             &CheckFormElement($cache, 'Interval', 'Interval', '1');  
         } elsif(/form\.HeadingColumn/) {          } elsif(/form\.HeadingColumn/) {
             my $value = $_;              my $value = $_;
             $value =~ s/form\.//;              $value =~ s/form\.//;
Line 170  sub ProcessFormData{ Line 193  sub ProcessFormData{
     $cache->{'DefaultColumns'} = 'false';      $cache->{'DefaultColumns'} = 'false';
   
     return;      return;
   
     # Select page to display  
     if(defined($ENV{'form.ProblemStatistics'}) ||  
        defined($ENV{'form.ProblemStatisticsRecalculate'}) ||   
        defined($ENV{'form.DisplayCSVFormat'})) {  
         $cache->{'GoToPage'} = 'ProblemStatistics';  
         &CheckFormElement($cache, 'DisplayCSVFormat',  
                           'DisplayFormat', 'Display Table Format');  
         &CheckFormElement($cache, 'Ascend','ProblemStatisticsAscend',  
                           'Ascending');  
         &CheckFormElement($cache, 'Maps', 'ProblemStatisticsMap',   
                           'All Maps');  
     } elsif(defined($ENV{'form.ProblemAnalysis'})) {  
         $cache->{'GoToPage'} = 'ProblemAnalysis';  
         &CheckFormElement($cache, 'Interval', 'Interval', '1');  
     } elsif(defined($ENV{'form.DoDiffGraph'})) {  
         $cache->{'GoToPage'} = 'DoDiffGraph';  
     } elsif(defined($ENV{'form.PercentWrongGraph'})) {  
         $cache->{'GoToPage'} = 'PercentWrongGraph';  
     } elsif(defined($ENV{'form.ActivityLog'})) {  
         $cache->{'GoToPage'} = 'ActivityLog';  
     } else {  
         $cache->{'GoToPage'} = 'Menu';  
     }  
   
     &CheckFormElement($cache, 'Status', 'Status', 'Active');  
   
     return;  
 }  }
   
 =pod  =pod
Line 298  sub SpaceColumns { Line 293  sub SpaceColumns {
 }  }
   
 sub PrepareData {  sub PrepareData {
     my ($c, $cacheDB, $studentInformation, $headings)=@_;      my ($c, $cacheDB, $studentInformation, $headings,$r)=@_;
   
     # Test for access to the cache data      # Test for access to the cache data
     my $courseID=$ENV{'request.course.id'};      my $courseID=$ENV{'request.course.id'};
Line 315  sub PrepareData { Line 310  sub PrepareData {
   
     # Download class list information if not using cached data      # Download class list information if not using cached data
     my %cache;      my %cache;
     unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_WRCREAT,0640)) {      unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_WRCREAT(),0640)) {
         return "Unable to tie hash to db file.";          return "Unable to tie hash to db file.";
     }      }
   
     if(!$isCached) {      if(!$isCached) {
         my $processTopResourceMapReturn=          my $processTopResourceMapReturn=
             &Apache::loncoursedata::ProcessTopResourceMap(\%cache, $c);              &Apache::loncoursedata::ProcessTopResourceMap(\%cache, $c, $r);
         if($processTopResourceMapReturn ne 'OK') {          if($processTopResourceMapReturn ne 'OK') {
             untie(%cache);              untie(%cache);
             return $processTopResourceMapReturn;              return $processTopResourceMapReturn;
Line 441  sub BuildClasslist { Line 436  sub BuildClasslist {
     my ($cacheDB,$students,$studentInformation,$headings)=@_;      my ($cacheDB,$students,$studentInformation,$headings)=@_;
   
     my %cache;      my %cache;
     unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER,0640)) {      unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) {
         return '<html><body>Unable to tie database.</body></html>';          return '<html><body>Unable to tie database.</body></html>';
     }      }
   
Line 544  sub BuildStatistics { Line 539  sub BuildStatistics {
     my %reports = ('classlist'          => 'Class list',      my %reports = ('classlist'          => 'Class list',
                    'problem_statistics' => 'Problem Statistics',                     'problem_statistics' => 'Problem Statistics',
                    'student_assessment' => 'Student Assessment',                     'student_assessment' => 'Student Assessment',
                      'activitylog'        => 'Activity Log',
                    'reportSelected'     => 'Class list');                     'reportSelected'     => 'Class list');
   
     my %cache;      my %cache;
Line 553  sub BuildStatistics { Line 549  sub BuildStatistics {
   
     my ($returnValue, $students) = &PrepareData($c, $cacheDB,       my ($returnValue, $students) = &PrepareData($c, $cacheDB, 
                                                 \@studentInformation,                                                   \@studentInformation, 
                                                 \@headings);                                                  \@headings,$r);
     if($returnValue ne 'OK') {      if($returnValue ne 'OK') {
         $r->print('<html><body>'.$returnValue."\n".'</body></html>');          $r->print('<html><body>'.$returnValue."\n".'</body></html>');
         return OK;          return OK;
     }      }
   
     my $GoToPage;      my $GoToPage;
     if(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER,0640)) {      if(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) {
         $GoToPage = $cache{'reportSelected'};          $GoToPage = $cache{'reportSelected'};
         $reports{'reportSelected'} = $cache{'reportSelected'};          $reports{'reportSelected'} = $cache{'reportSelected'};
         if(defined($cache{'reportKey'}) &&           if(defined($cache{'reportKey'}) && 

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


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