--- loncom/interface/statistics/lonproblemstatistics.pm 2002/08/05 18:10:08 1.12 +++ loncom/interface/statistics/lonproblemstatistics.pm 2002/08/05 20:53:38 1.13 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # (Publication Handler # -# $Id: lonproblemstatistics.pm,v 1.12 2002/08/05 18:10:08 minaeibi Exp $ +# $Id: lonproblemstatistics.pm,v 1.13 2002/08/05 20:53:38 stredwic Exp $ # # Copyright Michigan State University Board of Trustees # @@ -70,9 +70,13 @@ sub BuildProblemStatisticsPage { $Ptr .= ''; $Ptr .= &ProblemStatisticsLegend(); $r->print($Ptr); + $r->rflush(); untie(%cache); + &Create_PrgWin($r); + my $count=0; foreach (@$students) { + &Update_PrgWin(scalar(@$students),$count,$_,$r); my $courseData = &Apache::loncoursedata::DownloadCourseInformation($_, $courseID); last if ($c->aborted()); @@ -81,7 +85,9 @@ sub BuildProblemStatisticsPage { $courseData, $_); untie(%cache); } + $count++; } + &Close_PrgWin($r); if($c->aborted()) { return; } unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER,0640)) { @@ -178,6 +184,40 @@ sub CloseTable { } +# Create progress +sub Create_PrgWin { + my ($r)=@_; + $r->print(< + popwin=open('','popwin','width=400,height=100'); + popwin.document.writeln(''+ + 'LON-CAPA Statistics'+ + '

Computation Progress

'+ + '
'+ + '
'+ + ''); + popwin.document.close(); + +ENDPOP + + $r->rflush(); +} + +# update progress +sub Update_PrgWin { + my ($totalStudents,$index,$name,$r)=@_; + $r->print(''); + $r->rflush(); +} + +# close Progress Line +sub Close_PrgWin { + my ($r)=@_; + $r->print(''); + $r->rflush(); +} # ------ Dump the Student's DB file and handling the data for statistics table sub ExtractStudentData {