--- loncom/interface/statistics/lonstudentassessment.pm 2002/07/26 19:49:26 1.4 +++ loncom/interface/statistics/lonstudentassessment.pm 2002/08/05 20:53:38 1.7 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # (Publication Handler # -# $Id: lonstudentassessment.pm,v 1.4 2002/07/26 19:49:26 stredwic Exp $ +# $Id: lonstudentassessment.pm,v 1.7 2002/08/05 20:53:38 stredwic Exp $ # # Copyright Michigan State University Board of Trustees # @@ -49,7 +49,7 @@ sub BuildStudentAssessmentPage { $studentInformation,$r,$c)=@_; # $jr = $r; my %cache; - unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER,0640)) { + unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) { $r->print('Unable to tie database.'); return; } @@ -86,6 +86,7 @@ sub BuildStudentAssessmentPage { $students); $r->print(&CreateInterface(\%cache, $selectedName, $students, $formName, $doNotShow)); + $r->rflush(); my $Str = ''; if($selectedName eq 'No Student Selected') { @@ -98,39 +99,36 @@ sub BuildStudentAssessmentPage { $r->print(&CreateTableHeadings(\%cache, $spacing, $infoKeys, $infoHeadings, $sequenceKeys, $sequenceHeadings)); untie(%cache); + if($c->aborted()) { return $Str; } my $selected=0; $r->print('
'."\n");
     foreach (@$students) {
+        if($c->aborted()) {  return $Str; }
         next if ($_ ne $selectedName && 
                  $selectedName ne 'All Students');
         $selected = 1;
         my $courseData; 
-        if(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER,0640)) {
-            if($cache{$_.':lastDownloadTime'} eq 'Not downloaded') {
-                untie(%cache);
-                $courseData = 
-                    &Apache::loncoursedata::DownloadCourseInformation($_, 
-                                                                    $courseID);
-                if(tie(%cache,'GDBM_File',$cacheDB,&GDBM_WRCREAT,0640)) {
-                    &Apache::loncoursedata::ProcessStudentData(\%cache, 
-                                                             $courseData, $_);
-                    untie(%cache);
-                } else {
-                    last if($c->aborted());
-                    next;
-                }
-            } else {
-                untie(%cache);
+        my $downloadTime='';
+        if(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) {
+            $downloadTime = $cache{$_.':lastDownloadTime'};
+            untie(%cache);
+        }
+        if($downloadTime eq 'Not downloaded') {
+            $courseData = 
+                &Apache::loncoursedata::DownloadCourseInformation($_, 
+                                                                  $courseID);
+            unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_WRCREAT(),0640)) {
+                next;
             }
-        } else {
-            last if($c->aborted());
-            next;
+            &Apache::loncoursedata::ProcessStudentData(\%cache, 
+                                                       $courseData, $_);
+            untie(%cache);
         }
 
-        last if ($c->aborted());
+        next if($c->aborted());
 
-        if(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER,0640)) {
+        if(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) {
             my $displayString = 'DISPLAYDATA'.$spacing;
             $r->print(&Apache::lonhtmlcommon::FormatStudentInformation(
                                                          \%cache, $_,
@@ -139,6 +137,7 @@ sub BuildStudentAssessmentPage {
                                                          'preformatted'));
             $r->print(&StudentReport(\%cache, $_, $spacing, $sequenceKeys));
             $r->print("\n");
+            $r->rflush();
             untie(%cache);
         }
     }