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

matthew lon-capa-cvs@mail.lon-capa.org
Tue, 14 Oct 2003 14:23:14 -0000


matthew		Tue Oct 14 10:23:14 2003 EDT

  Modified files:              
    /loncom/interface/statistics	lonproblemanalysis.pm 
  Log:
  Minor code cleanup.  Additionally, most humans begin enumerating with 1, not 0, 
  so the first graph is now called 'plot 1' not 'plot 0'.
  
  
Index: loncom/interface/statistics/lonproblemanalysis.pm
diff -u loncom/interface/statistics/lonproblemanalysis.pm:1.34 loncom/interface/statistics/lonproblemanalysis.pm:1.35
--- loncom/interface/statistics/lonproblemanalysis.pm:1.34	Mon Oct 13 17:12:56 2003
+++ loncom/interface/statistics/lonproblemanalysis.pm	Tue Oct 14 10:23:14 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 #
 
-# $Id: lonproblemanalysis.pm,v 1.34 2003/10/13 21:12:56 matthew Exp $
+# $Id: lonproblemanalysis.pm,v 1.35 2003/10/14 14:23:14 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -218,25 +218,18 @@
         }
         $maxstu = 0 if (! $maxstu);
         $minstu = 0 if (! $minstu);
-        my $graphlink;
+        my $title;
         if ($maxstu == $minstu) {
-            $graphlink = &Apache::loncommon::DrawGraph
-                ('Attempt '.$i.', '.$maxstu.' students',
-                 'Foil Number',
-                 'Percent Correct',
-                 100,
-                 $PlotData[$i]->{'good'},
-                 $PlotData[$i]->{'bad'});
+            $title = 'Attempt '.$i.', '.$maxstu.' students';
         } else {
-            $graphlink = &Apache::loncommon::DrawGraph
-                ('Attempt '.$i.', '.$minstu.'-'.$maxstu.
-                 ' students',
-                 'Foil Number',
-                 'Percent Correct',
-                 100,
-                 $PlotData[$i]->{'good'},
-                 $PlotData[$i]->{'bad'});
+            $title = 'Attempt '.$i.', '.$minstu.'-'.$maxstu.' students';
         }
+        my $graphlink = &Apache::loncommon::DrawGraph($title,
+                                                      'Foil Number',
+                                                      'Percent Correct',
+                                                      100,
+                                                      $PlotData[$i]->{'good'},
+                                                      $PlotData[$i]->{'bad'});
         push(@Plots,$graphlink);
     }
     #
@@ -334,7 +327,7 @@
                 last if ($PerformanceData->[$j]->[2] > $endtime);
             }
             $end_index = $j;
-            $plottitle = 'Tries plot '.$i;
+            $plottitle = 'Tries plot '.($i+1);
         }
 
         ($plothtml,$starttime,$endtime,$data) =