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

minaeibi lon-capa-cvs@mail.lon-capa.org
Sat, 11 Jan 2003 06:31:26 -0000


minaeibi		Sat Jan 11 01:31:26 2003 EDT

  Modified files:              
    /loncom/interface/statistics	lonpercentage.pm 
  Log:
  Fixed bug #1052.
  The graph of percentage of correct problems shows zeroz, so the distribution of corrected problems are shown better.
  If get more feedback I will complete it.
  
  
  
Index: loncom/interface/statistics/lonpercentage.pm
diff -u loncom/interface/statistics/lonpercentage.pm:1.4 loncom/interface/statistics/lonpercentage.pm:1.5
--- loncom/interface/statistics/lonpercentage.pm:1.4	Tue Jan  7 22:27:54 2003
+++ loncom/interface/statistics/lonpercentage.pm	Sat Jan 11 01:31:26 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # (Publication Handler
 #
-# $Id: lonpercentage.pm,v 1.4 2003/01/08 03:27:54 minaeibi Exp $
+# $Id: lonpercentage.pm,v 1.5 2003/01/11 06:31:26 minaeibi Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -246,17 +246,30 @@
 	$pno++;
     }
 
-#     $r->print('<br>max='.$max);
-#     $r->print('<br> percentcount='.join(',', @percentCount));
-#     $r->print('<br> percent='.join(',', @percent));
+#   $r->print('<br>max='.$max);
+#   $r->print('<br> percentcount='.join(',', @percentCount));
+#   $r->print('<br> percent='.join(',', @percent));
+
+    my $cId=0;
+    my @data1=();
+    my @data2=();
+    for (my $nIdx=0; $nIdx<$pno; $nIdx++ ) {
+	$data1[$cId]=$percent[$nIdx];
+        $data2[$cId]=$percentCount[$nIdx];
+	my $cr=$percent[$nIdx+1];
+	while ($data1[$cId]<$cr) {
+	    $cId++;
+            $data1[$cId]=$cId;
+            $data2[$cId]=0;
+        }
+    }
 
-    my @GData = ('','Percentage','Number_of_Students',$max,$pno,
-                 join(',',@percent), join(',', @percentCount));
+#   $r->print('<br> percentcount='.join(',', @data1));
+#   $r->print('<br> percent='.join(',', @data2));
 
 
-#    my @GData = ('', 'Percentage', 'Number_of_Students', 
-#		 $max, scalar(@percent), 
-#                 join(',',@percent), join(',', @percentCount));
+    my @GData = ('','Percentage','Number_of_Students',$max,101 ,
+                 join(',',@data1), join(',', @data2));
 
     $Ptr .= '</form>'."\n";
     $Ptr .= '<IMG src="/cgi-bin/graph.png?'.(join('&', @GData));