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

matthew lon-capa-cvs@mail.lon-capa.org
Mon, 04 Oct 2004 19:49:41 -0000


matthew		Mon Oct  4 15:49:41 2004 EDT

  Modified files:              
    /loncom/interface/statistics	lonproblemanalysis.pm 
  Log:
  OR tries analysis now checks for missing data and gives a friendly
  message instead of showing a bunch of empty graphs.
  
  
Index: loncom/interface/statistics/lonproblemanalysis.pm
diff -u loncom/interface/statistics/lonproblemanalysis.pm:1.91 loncom/interface/statistics/lonproblemanalysis.pm:1.92
--- loncom/interface/statistics/lonproblemanalysis.pm:1.91	Mon Oct  4 15:10:26 2004
+++ loncom/interface/statistics/lonproblemanalysis.pm	Mon Oct  4 15:49:41 2004
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonproblemanalysis.pm,v 1.91 2004/10/04 19:10:26 matthew Exp $
+# $Id: lonproblemanalysis.pm,v 1.92 2004/10/04 19:49:41 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -663,6 +663,18 @@
     if (defined($Concepts)) { $num_concepts = scalar(@$Concepts); }
     #
     for (my $try=$mintries;$try<=$maxtries;$try++) {
+        if (! defined($response_data{'_total'}->[$try]) ||
+            $response_data{'_total'}->[$try] == 0) { 
+            if ($try > 1) {
+                $analysis_html.= '<tr><td align="center" colspan="4"><b>'.
+                    &mt('None of the selected students attempted the problem more than [_1] times.',$try-1).
+                    '</b></td></tr>';
+            } else {
+                $analysis_html.= '<tr><td colspan="4" align="center"><b>'.
+                    &mt('None of the selected students have attempted the problem').'</b></td></tr>';
+            }
+            last;
+        }
         my $concept_graph='';
         if ($num_concepts > 1) {
             #