--- loncom/interface/statistics/lonproblemanalysis.pm 2002/07/30 21:31:48 1.2 +++ loncom/interface/statistics/lonproblemanalysis.pm 2002/08/01 20:49:06 1.3 @@ -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.3 2002/08/01 20:49:06 stredwic Exp $ # # Copyright Michigan State University Board of Trustees # @@ -48,7 +48,7 @@ sub BuildProblemAnalysisPage { my %cache; my $Str = ''; - 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; } @@ -73,20 +73,26 @@ sub BuildAnalyzePage { 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, $_); + my $downloadTime=''; + if(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) { + $downloadTime = $cache{$_.':lastDownloadTime'}; untie(%cache); - } else { - last if($c->aborted()); - next; + } + 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; + } } } - 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; } @@ -108,17 +114,22 @@ sub BuildAnalyzePage { return $Str; } + if($c->aborted()) { untie(%cache); return $Str; } + #compute the intervals &Interval($part, $problem, $interval, $analyzeData->{'concepts'}, \%ConceptData); $title =~ s/\ /"_"/eg; $Str .= '
'.$uri.''; + + if($c->aborted()) { untie(%cache); return $Str; } #Java script Progress window # &Create_PrgWin(); # &Update_PrgWin("Starting-to-analyze-problem"); for(my $index=0; $index<(scalar @$students); $index++) { + if($c->aborted()) { untie(%cache); return $Str; } # &Update_PrgWin($index); # &OpStatus($problem, $students->[$index], $courseID, \%ConceptData, # $analyzeData->{'foil_to_concept'}, $analyzeData, \%cache); @@ -129,10 +140,12 @@ sub BuildAnalyzePage { $Str .= '
'; for (my $k=0; $k<$interval; $k++ ) { + if($c->aborted()) { untie(%cache); return $Str; } $Str .= &DrawGraph($k, $title, $analyzeData->{'concepts'}, \%ConceptData); } for (my $k=0; $k<$interval; $k++ ) { + if($c->aborted()) { untie(%cache); return $Str; } $Str .= &DrawTable($k, $analyzeData->{'concepts'}, \%ConceptData); } my $Answ=&Apache::lonnet::ssi($uri);