[LON-CAPA-cvs] cvs: loncom /interface/statistics lonstudentassessment.pm

stredwic lon-capa-cvs@mail.lon-capa.org
Wed, 31 Jul 2002 14:35:38 -0000


stredwic		Wed Jul 31 10:35:38 2002 EDT

  Modified files:              
    /loncom/interface/statistics	lonstudentassessment.pm 
  Log:
  For some reason, tieing to a hash inside of an if that ties the hash was
  causing problems periodically.  I broke the two ties into sequential 
  commands.
  
  
Index: loncom/interface/statistics/lonstudentassessment.pm
diff -u loncom/interface/statistics/lonstudentassessment.pm:1.4 loncom/interface/statistics/lonstudentassessment.pm:1.5
--- loncom/interface/statistics/lonstudentassessment.pm:1.4	Fri Jul 26 15:49:26 2002
+++ loncom/interface/statistics/lonstudentassessment.pm	Wed Jul 31 10:35:38 2002
@@ -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.5 2002/07/31 14:35:38 stredwic Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -106,26 +106,22 @@
                  $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)) {
+                last if($c->aborted());
+                next;
             }
-        } else {
-            last if($c->aborted());
-            next;
+            &Apache::loncoursedata::ProcessStudentData(\%cache, 
+                                                       $courseData, $_);
+            untie(%cache);
         }
 
         last if ($c->aborted());