--- loncom/interface/statistics/lonproblemanalysis.pm 2002/07/30 21:31:48 1.2 +++ loncom/interface/statistics/lonproblemanalysis.pm 2002/08/13 14:44:33 1.6 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # (Publication Handler # -# $Id: lonproblemanalysis.pm,v 1.2 2002/07/30 21:31:48 stredwic Exp $ +# $Id: lonproblemanalysis.pm,v 1.6 2002/08/13 14:44:33 stredwic Exp $ # # Copyright Michigan State University Board of Trustees # @@ -44,21 +44,21 @@ use GDBM_File; my $jr; sub BuildProblemAnalysisPage { - my ($cacheDB)=@_; + my ($cacheDB, $r)=@_; my %cache; - my $Str = ''; - unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER,0640)) { - $Str .= '
Unable to tie database.'; - return $Str; + unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) { + $r->print('Unable to tie database.'); + return; } - $Str .= &IntervalOptions($cache{'Interval'}); - $Str .= &OptionResponseTable($cache{'OptionResponses'}, \%cache); + $r->print(&IntervalOptions($cache{'Interval'})); + $r->rflush(); + $r->print(&OptionResponseTable($cache{'OptionResponses'}, \%cache)); untie(%cache); - return $Str; + return; } sub BuildAnalyzePage { @@ -69,26 +69,19 @@ sub BuildAnalyzePage { my $Str = ''; my %cache; - foreach (@$students) { - if($c->aborted) { - return $Str; - } - my $courseData = - &Apache::loncoursedata::DownloadCourseInformation($_, - $courseID); - if(tie(%cache,'GDBM_File',$cacheDB,&GDBM_WRCREAT,0640)) { - &Apache::loncoursedata::ProcessStudentData(\%cache, - $courseData, $_); - untie(%cache); - } else { - last if($c->aborted()); - next; - } + if(&Apache::loncoursedata::DownloadStudentCourseDataSeparate($students, 'true', + $cacheDB, 'true', + 'true', $courseID, + $r, $c) ne 'OK') { + $r->print($Str); + return; } - unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER,0640)) { + + unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) { $Str .= 'Unable to tie database.'; - return $Str; + $r->print($Str); + return; } my ($problemId, $part, $responseId)=split(':',$cache{'AnalyzeInfo'}); @@ -104,43 +97,55 @@ sub BuildAnalyzePage { my ($analyzeData) = &InitAnalysis($uri, $part, $responseId, $problem, $students->[0], $courseID); if(defined($analyzeData->{'error'})) { - $Str .= 'Incorrect part requested.