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

matthew lon-capa-cvs@mail.lon-capa.org
Mon, 29 Mar 2004 18:22:28 -0000


matthew		Mon Mar 29 13:22:28 2004 EDT

  Modified files:              
    /loncom/interface/statistics	lonproblemstatistics.pm 
  Log:
  Removed some logging code.  Fixed bug with stats display always being in 
  'ungrouped' mode.
  
  
Index: loncom/interface/statistics/lonproblemstatistics.pm
diff -u loncom/interface/statistics/lonproblemstatistics.pm:1.74 loncom/interface/statistics/lonproblemstatistics.pm:1.75
--- loncom/interface/statistics/lonproblemstatistics.pm:1.74	Mon Mar 29 10:58:33 2004
+++ loncom/interface/statistics/lonproblemstatistics.pm	Mon Mar 29 13:22:28 2004
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonproblemstatistics.pm,v 1.74 2004/03/29 15:58:33 matthew Exp $
+# $Id: lonproblemstatistics.pm,v 1.75 2004/03/29 18:22:28 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -310,18 +310,34 @@
     # This probably does not need to be done each time we are called, but
     # it does not slow things down noticably.
     &Apache::loncoursedata::populate_weight_table();
+    #
     if (exists($ENV{'form.Excel'})) {
         &Excel_output($r);
     } else {
+        my $count = 0;
+        foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) {
+            $count += $seq->{'num_assess'};
+        }
+        if ($count > 10) {
+            $r->print('<h2>'.
+                      &mt('Compiling statistics for [_1] problems',$count).
+                      '</h2>');
+            if ($count > 30) {
+                $r->print('<h3>'.&mt('This will take some time.').'</h3>');
+            }
+            $r->rflush();
+        }
+        #
         my $sortby = $ENV{'form.sortby'};
         $sortby = 'container' if (! defined($sortby) || $sortby =~ /^\s*$/);
         my $plot = $ENV{'form.plot'};
-        &Apache::lonnet::logthis('form.plot = '.$plot);
+        if ($plot eq '' || $plot eq 'none') {
+            undef($plot);
+        }
         if ($sortby eq 'container' && ! defined($plot)) {
             &output_html_by_sequence($r);
         } else {
             if (defined($plot)) {
-                &Apache::lonnet::logthis('calling plot routine');
                 &make_plot($r,$plot);
             }
             &output_html_stats($r);
@@ -384,7 +400,6 @@
     $r->print("</table>\n</table>\n");
     return;
 }
-
 
 sub html_preamble {
     my $Str='';