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

minaeibi lon-capa-cvs@mail.lon-capa.org
Mon, 13 Jan 2003 17:31:41 -0000


minaeibi		Mon Jan 13 12:31:41 2003 EDT

  Modified files:              
    /loncom/interface/statistics	lonpercentage.pm 
  Log:
  To fix bug #1152 this is changed in lonpercentage.pm
  When cousre has more than or equal 100 then the range will be 100.
  otherwise it would be the range of x's would be the number of broblems.
  
  
  
  
Index: loncom/interface/statistics/lonpercentage.pm
diff -u loncom/interface/statistics/lonpercentage.pm:1.6 loncom/interface/statistics/lonpercentage.pm:1.7
--- loncom/interface/statistics/lonpercentage.pm:1.6	Sun Jan 12 19:15:16 2003
+++ loncom/interface/statistics/lonpercentage.pm	Mon Jan 13 12:31:41 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # (Publication Handler
 #
-# $Id: lonpercentage.pm,v 1.6 2003/01/13 00:15:16 minaeibi Exp $
+# $Id: lonpercentage.pm,v 1.7 2003/01/13 17:31:41 minaeibi Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -241,10 +241,6 @@
     my $max = 0;
     my $pno = 0;
 
-    my $xlabel = ($totalProblems >= 100 ) ? 
-                  'Percentage_of_Problems_Correct' :
-                  'Number_of_Problems_Correct';
-
     foreach my $key (sort NumericSort keys(%percentages)) {
 	push(@percent, $key);
 	my @temp = split(':::', $percentages{$key});
@@ -270,7 +266,17 @@
         }
     }
 
-#   $r->print('<br> xlable='.$xlabel);
+    my $xlabel;
+    my $Freq;
+    if ($totalProblems >= 100 ) {
+        $xlabel = 'Percentage_of_Problems_Correct';
+        $Freq=100;
+    } else {
+        $xlabel = 'Number_of_Problems_Correct';
+        $Freq = $cId;
+    }
+
+#   $r->print('<br>Freq='.$Freq);
 #   $r->print('<br>max='.$max);
 #   $r->print('<br> percentcount='.join(',', @percentCount)); 
 #   $r->print('<br> percent='.join(',', @percent));
@@ -278,7 +284,7 @@
 #   $r->print('<br> percent='.join(',', @data2));
 
     my @GData = ("Percentage",$xlabel,
-                 'Number_of_Students',$max,100 ,
+                 'Number_of_Students',$max,$Freq,
                  join(',',@data1), join(',', @data2));
 
     $Ptr .= '</form>'."\n";