--- loncom/interface/statistics/lonproblemanalysis.pm 2002/08/05 20:53:38 1.4 +++ 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.4 2002/08/05 20:53:38 stredwic Exp $ +# $Id: lonproblemanalysis.pm,v 1.5 2002/08/13 00:37:18 stredwic Exp $ # # Copyright Michigan State University Board of Trustees # @@ -41,7 +41,7 @@ use strict; use Apache::lonnet(); use GDBM_File; -#my $jr; +my $jr; sub BuildProblemAnalysisPage { my ($cacheDB, $r)=@_; @@ -64,42 +64,24 @@ sub BuildProblemAnalysisPage { sub BuildAnalyzePage { my ($cacheDB, $students, $courseID,$r)=@_; -# $jr = $r; + $jr = $r; my $c = $r->connection; my $Str = ''; my %cache; - &Create_PrgWin($r); - my $count=0; - foreach (@$students) { - &Update_PrgWin(scalar(@$students),$count,$_,$r); - 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; - } - } - $count++; + if(&Apache::loncoursedata::DownloadStudentCourseDataSeparate($students, 'true', + $cacheDB, 'true', + 'true', $courseID, + $r, $c) ne 'OK') { + $r->print($Str); + return; } - &Close_PrgWin($r); + 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'}); @@ -115,11 +97,14 @@ sub BuildAnalyzePage { my ($analyzeData) = &InitAnalysis($uri, $part, $responseId, $problem, $students->[0], $courseID); if(defined($analyzeData->{'error'})) { - $Str .= 'Incorrect part requested.