--- loncom/interface/statistics/lonproblemanalysis.pm 2002/08/01 20:49:06 1.3 +++ loncom/interface/statistics/lonproblemanalysis.pm 2002/08/13 00:37:18 1.5 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # (Publication Handler # -# $Id: lonproblemanalysis.pm,v 1.3 2002/08/01 20:49:06 stredwic Exp $ +# $Id: lonproblemanalysis.pm,v 1.5 2002/08/13 00:37:18 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; + $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,32 +69,19 @@ sub BuildAnalyzePage { my $Str = ''; my %cache; - foreach (@$students) { - if($c->aborted) { - return $Str; - } - my $downloadTime=''; - if(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) { - $downloadTime = $cache{$_.':lastDownloadTime'}; - untie(%cache); - } - if($downloadTime eq 'Not downloaded') { - my $courseData = - &Apache::loncoursedata::DownloadCourseInformation($_, - $courseID); - if(tie(%cache,'GDBM_File',$cacheDB,&GDBM_WRCREAT(),0640)) { - &Apache::loncoursedata::ProcessStudentData(\%cache, - $courseData, $_); - untie(%cache); - } else { - 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)) { $Str .= 'Unable to tie database.'; - return $Str; + $r->print($Str); + return; } my ($problemId, $part, $responseId)=split(':',$cache{'AnalyzeInfo'}); @@ -110,11 +97,14 @@ sub BuildAnalyzePage { my ($analyzeData) = &InitAnalysis($uri, $part, $responseId, $problem, $students->[0], $courseID); if(defined($analyzeData->{'error'})) { - $Str .= 'Incorrect part requested.