--- loncom/interface/statistics/lonproblemstatistics.pm 2003/09/29 16:20:18 1.59 +++ loncom/interface/statistics/lonproblemstatistics.pm 2003/10/24 13:36:16 1.60 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonproblemstatistics.pm,v 1.59 2003/09/29 16:20:18 matthew Exp $ +# $Id: lonproblemstatistics.pm,v 1.60 2003/10/24 13:36:16 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -751,8 +751,12 @@ sub plot_statistics { } } - $r->print("

".&DrawGraph(\@Data,$title,'Problem Number',$yaxis, - $Max)."

\n"); + $r->print("

".&Apache::loncommon::DrawBarGraph($title, + 'Problem Number', + $yaxis, + $Max, + undef, + \@Data)."

\n"); # # Print out the data $ENV{'form.sortby'} = 'Contents'; @@ -760,38 +764,6 @@ sub plot_statistics { return; } -############################################### -############################################### - -=pod - -=item &DrawGraph() - -=cut - -############################################### -############################################### -sub DrawGraph { - my ($values,$title,$xaxis,$yaxis,$Max)=@_; - $title = '' if (! defined($title)); - $xaxis = '' if (! defined($xaxis)); - $yaxis = '' if (! defined($yaxis)); - $title = &Apache::lonnet::escape($title); - $xaxis = &Apache::lonnet::escape($xaxis); - $yaxis = &Apache::lonnet::escape($yaxis); - # - my $sendValues = join(',', @$values); - my $sendCount = scalar(@$values); - $Max =1 if ($Max < 1); - if ( int($Max) < $Max ) { - $Max++; - $Max = int($Max); - } - my @GData = ($title,$xaxis,$yaxis,$Max,$sendCount,$sendValues); - return ''; -} - sub get_statistics { my ($sequence,$resource,$part,$problem_num) = @_; #