--- loncom/interface/loncoursedata.pm 2003/02/28 23:19:01 1.54 +++ loncom/interface/loncoursedata.pm 2003/03/03 21:52:24 1.55 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: loncoursedata.pm,v 1.54 2003/02/28 23:19:01 bowersj2 Exp $ +# $Id: loncoursedata.pm,v 1.55 2003/03/03 21:52:24 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1308,21 +1308,20 @@ sub DownloadStudentCourseData { $WhatIWant .= ')'; # $WhatIWant = '.'; + my %prog_state; if($status eq 'true') { - &Apache::lonhtmlcommon::Create_PrgWin($r, $title, $heading); + %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r, $title, + $heading,($#$students)+1); } - my $displayString; - my $count=0; foreach (@$students) { my %cache; if($c->aborted()) { return 'Aborted'; } if($status eq 'true') { - $count++; - my $displayString = $count.'/'.$studentCount.': '.$_; - &Apache::lonhtmlcommon::Update_PrgWin($displayString, $r); + &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state, + 'last student '.$_); } my $downloadTime='Not downloaded'; @@ -1359,7 +1358,7 @@ sub DownloadStudentCourseData { next; } } - if($status eq 'true') { &Apache::lonhtmlcommon::Close_PrgWin($r); } + if($status eq 'true') { &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); } return 'OK'; } @@ -1380,10 +1379,11 @@ sub DownloadStudentCourseDataSeparate { &CheckForResidualDownload($cacheDB, 'true', 'true', $courseID, $r, $c); my $studentCount = scalar(@$students); + my %prog_state; if($status eq 'true') { - &Apache::lonhtmlcommon::Create_PrgWin($r, $title, $heading); + %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r, $title, + $heading,($#$students)+1); } - my $count=0; my $displayString=''; foreach (@$students) { if($c->aborted()) { @@ -1391,9 +1391,8 @@ sub DownloadStudentCourseDataSeparate { } if($status eq 'true') { - $count++; - $displayString = $count.'/'.$studentCount.': '.$_; - &Apache::lonhtmlcommon::Update_PrgWin($displayString, $r); + &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state, + 'last student '.$_); } my %cache; @@ -1438,7 +1437,8 @@ sub DownloadStudentCourseDataSeparate { } untie(%downloadData); } - if($status eq 'true') { &Apache::lonhtmlcommon::Close_PrgWin($r); } + if($status eq 'true') { &Apache::lonhtmlcommon::Close_PrgWin($r, + \%prog_state); } return &CheckForResidualDownload($cacheDB, 'true', 'true', $courseID, $r, $c); @@ -1477,8 +1477,10 @@ sub CheckForResidualDownload { my $heading = 'Process Course Data'; my $title = 'LON-CAPA Statistics'; my $studentCount = scalar(@students); + my %prog_state; if($status eq 'true') { - &Apache::lonhtmlcommon::Create_PrgWin($r, $title, $heading); + %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r, $title, + $heading,$#students+1); } my $count=1; @@ -1486,8 +1488,8 @@ sub CheckForResidualDownload { last if($c->aborted()); if($status eq 'true') { - my $displayString = $count.'/'.$studentCount.': '.$name; - &Apache::lonhtmlcommon::Update_PrgWin($displayString, $r); + &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state, + 'last student '.$name); } if($extract eq 'true') { @@ -1498,7 +1500,8 @@ sub CheckForResidualDownload { $count++; } - if($status eq 'true') { &Apache::lonhtmlcommon::Close_PrgWin($r); } + if($status eq 'true') { &Apache::lonhtmlcommon::Close_PrgWin($r, + \%prog_state); } untie(%cache); untie(%downloadData);