--- loncom/interface/statistics/lonpercentage.pm 2003/01/13 00:15:16 1.6
+++ loncom/interface/statistics/lonpercentage.pm 2003/01/13 17:31:41 1.7
@@ -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 @@ sub GraphData {
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 @@ sub GraphData {
}
}
-# $r->print('
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('
Freq='.$Freq);
# $r->print('
max='.$max);
# $r->print('
percentcount='.join(',', @percentCount));
# $r->print('
percent='.join(',', @percent));
@@ -278,7 +284,7 @@ sub GraphData {
# $r->print('
percent='.join(',', @data2));
my @GData = ("Percentage",$xlabel,
- 'Number_of_Students',$max,100 ,
+ 'Number_of_Students',$max,$Freq,
join(',',@data1), join(',', @data2));
$Ptr .= ''."\n";