--- loncom/interface/lonstatistics.pm 2002/09/03 01:32:10 1.47.2.1 +++ loncom/interface/lonstatistics.pm 2002/08/28 22:42:15 1.48 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # (Publication Handler # -# $Id: lonstatistics.pm,v 1.47.2.1 2002/09/03 01:32:10 albertel Exp $ +# $Id: lonstatistics.pm,v 1.48 2002/08/28 22:42:15 stredwic Exp $ # # Copyright Michigan State University Board of Trustees # @@ -318,14 +318,14 @@ sub PrepareData { return "Unable to tie hash to db file."; } -# if(!$isCached) { + if(!$isCached) { my $processTopResourceMapReturn= - &Apache::loncoursedata::ProcessTopResourceMap(\%cache, $c); + &Apache::loncoursedata::ProcessTopResourceMap(\%cache, $c, $r); if($processTopResourceMapReturn ne 'OK') { untie(%cache); return $processTopResourceMapReturn; } - # } + } if($c->aborted()) { untie(%cache); @@ -359,41 +359,40 @@ sub PrepareData { &SpaceColumns($students, $studentInformation, $headings, \%cache); $cache{'updateTime:columnWidth'}=24; - if($cache{'download'} ne 'false') { - my @who = ($cache{'download'}); + my $download = $cache{'download'}; + my $downloadAll = $cache{'DownloadAll'}; + my @allStudents=(); + if($download ne 'false') { $cache{'download'} = 'false'; + } elsif($downloadAll ne 'false') { + $cache{'DownloadAll'} = 'false'; + if($downloadAll eq 'sorted') { + @allStudents = @$students; + } else { + @allStudents = split(':::', $cache{'NamesOfStudents'}); + } + } + + untie(%cache); + + if($download ne 'false') { + my @who = ($download); if(&Apache::loncoursedata::DownloadStudentCourseData(\@who, 'false', $cacheDB, 'true', 'false', $courseID, $r, $c) ne 'OK') { - untie(%cache); return 'Stop at download individual'; } - } elsif($cache{'DownloadAll'} ne 'false') { - $cache{'DownloadAll'} = 'false'; - my @allStudents; - if($cache{'DownloadAll'} eq 'sorted') { - @allStudents = @$students; - } else { - @allStudents = split(':::', $cache{'NamesOfStudents'}); - } + } elsif($downloadAll ne 'false') { if(&Apache::loncoursedata::DownloadStudentCourseData(\@allStudents, 'false', $cacheDB, 'true', 'true', $courseID, $r, $c) ne 'OK') { - untie(%cache); return 'Stop at download all'; } } - if($c->aborted()) { - untie(%cache); - return 'aborted'; - } - - untie(%cache); - return ('OK', $students); }