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

version 1.38, 2002/08/01 20:49:06 version 1.39, 2002/08/05 20:53:38
Line 364  sub PrepareData { Line 364  sub PrepareData {
         &Apache::loncoursedata::ProcessStudentData(\%cache, $courseData, $who);          &Apache::loncoursedata::ProcessStudentData(\%cache, $courseData, $who);
         $cache{'download'} = 'false';          $cache{'download'} = 'false';
     } elsif($cache{'DownloadAll'} ne 'false') {      } elsif($cache{'DownloadAll'} ne 'false') {
           $cache{'DownloadAll'} = 'false';
         my @allStudents;          my @allStudents;
         if($cache{'DownloadAll'} eq 'sorted') {          if($cache{'DownloadAll'} eq 'sorted') {
             @allStudents = @$students;              @allStudents = @$students;
         } else {          } else {
             @allStudents = split(':::', $cache{'NamesOfStudents'});              @allStudents = split(':::', $cache{'NamesOfStudents'});
         }          }
           &Create_PrgWin($r);
           my $count=1;
         foreach (@allStudents) {          foreach (@allStudents) {
               &Update_PrgWin(scalar(@allStudents),$count,$_,$r);
             my $courseData =               my $courseData = 
                 &Apache::loncoursedata::DownloadCourseInformation(                  &Apache::loncoursedata::DownloadCourseInformation(
                                              $_, $courseID,                                                $_, $courseID, 
Line 381  sub PrepareData { Line 385  sub PrepareData {
                 untie(%cache);                  untie(%cache);
                 return 'aborted';                   return 'aborted'; 
             }              }
               $count++;
         }          }
         $cache{'DownloadAll'} = 'false';          &Close_PrgWin($r);
     }      }
   
     if($c->aborted()) {      if($c->aborted()) {
Line 433  sub Close_PrgWin { Line 438  sub Close_PrgWin {
   
   
 sub BuildClasslist {  sub BuildClasslist {
     my ($cacheDB,$students,$studentInformation,$headings)=@_;      my ($cacheDB,$students,$studentInformation,$headings,$r)=@_;
   
     my %cache;      my %cache;
     unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) {      unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) {
Line 446  sub BuildClasslist { Line 451  sub BuildClasslist {
   
     my $displayString = '<td align="left"><a href="/adm/statistics?';      my $displayString = '<td align="left"><a href="/adm/statistics?';
     $displayString .= 'sort=LINKDATA">DISPLAYDATA&nbsp</a></td>'."\n";      $displayString .= 'sort=LINKDATA">DISPLAYDATA&nbsp</a></td>'."\n";
     $Str .= &Apache::lonhtmlcommon::CreateHeadings(\%cache, $studentInformation,      $Str .= &Apache::lonhtmlcommon::CreateHeadings(\%cache, 
                                                      $studentInformation,
                                                    $headings, $displayString);                                                     $headings, $displayString);
     $Str .= '</tr>'."\n";      $Str .= '</tr>'."\n";
   
     my $alternate=0;      my $alternate=0;
     foreach (@$students) {      foreach (@$students) {
         my ($username, $domain) = split(':', $_);          my ($username, $domain) = split(':', $_);
Line 483  sub BuildClasslist { Line 490  sub BuildClasslist {
   
     $Str .= '</tr>'."\n";      $Str .= '</tr>'."\n";
     $Str .= '</table></td></tr></table>'."\n";      $Str .= '</table></td></tr></table>'."\n";
       $r->print($Str);
       $r->rflush();
   
     untie(%cache);      untie(%cache);
   
     return $Str;      return;
 }  }
   
 sub CreateMainMenu {  sub CreateMainMenu {
Line 573  sub BuildStatistics { Line 582  sub BuildStatistics {
         $r->print('<form name="Statistics" ');          $r->print('<form name="Statistics" ');
         $r->print('method="post" action="/adm/statistics">');          $r->print('method="post" action="/adm/statistics">');
         $r->print(&CreateMainMenu($cache{'Status'}, \%reports));          $r->print(&CreateMainMenu($cache{'Status'}, \%reports));
           $r->rflush();
         untie(%cache);          untie(%cache);
     } else {      } else {
         $r->print('<html><body>Unable to tie database.</body></html>');          $r->print('<html><body>Unable to tie database.</body></html>');
Line 587  sub BuildStatistics { Line 597  sub BuildStatistics {
                                                                   $courseID,                                                                     $courseID, 
                                                                   $c,$r);                                                                    $c,$r);
     } elsif($GoToPage eq 'Problem Analysis') {      } elsif($GoToPage eq 'Problem Analysis') {
         $r->print(          &Apache::lonproblemanalysis::BuildProblemAnalysisPage($cacheDB, $r);
               &Apache::lonproblemanalysis::BuildProblemAnalysisPage($cacheDB));  
     } elsif($GoToPage eq 'Student Assessment') {      } elsif($GoToPage eq 'Student Assessment') {
         $r->print(          &Apache::lonstudentassessment::BuildStudentAssessmentPage($cacheDB,
             &Apache::lonstudentassessment::BuildStudentAssessmentPage($cacheDB,  
                                                           $students,                                                            $students,
                                                           $courseID,                                                            $courseID,
                                                           'Statistics',                                                            'Statistics',
                                                           \@headings,                                                            \@headings,
                                                           $spacing,                                                            $spacing,
                                                           \@studentInformation,                                                            \@studentInformation,
                                                           $r, $c));                                                            $r, $c);
     } elsif($GoToPage eq 'Analyze') {      } elsif($GoToPage eq 'Analyze') {
         $r->print(&Apache::lonproblemanalysis::BuildAnalyzePage($cacheDB,           &Apache::lonproblemanalysis::BuildAnalyzePage($cacheDB, $students, 
                                                                 $students,                                                         $courseID, $r);
                                                                 $courseID,$r));  
     } elsif($GoToPage eq 'DoDiffGraph') {      } elsif($GoToPage eq 'DoDiffGraph') {
         &Apache::lonproblemstatistics::BuildDiffGraph($r);          &Apache::lonproblemstatistics::BuildDiffGraph($r);
     } elsif($GoToPage eq 'PercentWrongGraph') {      } elsif($GoToPage eq 'PercentWrongGraph') {
         &Apache::lonproblemstatistics::BuildWrongGraph($r);          &Apache::lonproblemstatistics::BuildWrongGraph($r);
     } elsif($GoToPage eq 'Class list') {      } elsif($GoToPage eq 'Class list') {
         $r->print(&BuildClasslist($cacheDB, $students, \@studentInformation,          &BuildClasslist($cacheDB, $students, \@studentInformation,
                                   \@headings));                          \@headings, $r);
     }      }
   
     $r->print('</form>'."\n");      $r->print('</form>'."\n");

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


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