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

matthew lon-capa-cvs@mail.lon-capa.org
Fri, 04 Mar 2005 04:36:36 -0000


matthew		Thu Mar  3 23:36:36 2005 EDT

  Modified files:              
    /loncom/interface/statistics	lonproblemstatistics.pm 
  Log:
  Fix bug where Excel output failed.
  
  
Index: loncom/interface/statistics/lonproblemstatistics.pm
diff -u loncom/interface/statistics/lonproblemstatistics.pm:1.98 loncom/interface/statistics/lonproblemstatistics.pm:1.99
--- loncom/interface/statistics/lonproblemstatistics.pm:1.98	Thu Mar  3 13:56:26 2005
+++ loncom/interface/statistics/lonproblemstatistics.pm	Thu Mar  3 23:36:35 2005
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonproblemstatistics.pm,v 1.98 2005/03/03 18:56:26 matthew Exp $
+# $Id: lonproblemstatistics.pm,v 1.99 2005/03/04 04:36:35 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -713,6 +713,13 @@
     # it does not slow things down noticably.
     &Apache::loncoursedata::populate_weight_table();
     #
+    ($navmap,@sequences) = 
+        &Apache::lonstatistics::selected_sequences_with_assessments();
+    if (! ref($navmap)) {
+        $r->print('<h1>'.&mt('A course-wide error occured.').'</h1>'.
+                  '<h3>'.$navmap.'</h3>');
+        return;
+    }
     if (exists($ENV{'form.Excel'})) {
         &Excel_output($r);
     } else { 
@@ -720,13 +727,6 @@
                   &mt('Produce Excel Output').'" />'.'&nbsp;'x5);
         $r->rflush();
         my $count = 0;
-        ($navmap,@sequences) = 
-            &Apache::lonstatistics::selected_sequences_with_assessments();
-        if (! ref($navmap)) {
-            $r->print('<h1>'.&mt('A course-wide error occured.').'</h1>'.
-                      '<h3>'.$navmap.'</h3>');
-            return;
-        }
         foreach my $seq (@sequences) {
             my @resources = 
                 &Apache::lonstathelpers::get_resources($navmap,$seq);