--- loncom/interface/statistics/lonproblemstatistics.pm 2003/09/29 16:20:18 1.59 +++ loncom/interface/statistics/lonproblemstatistics.pm 2003/11/11 22:14:28 1.61 @@ -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.61 2003/11/11 22:14:28 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -265,6 +265,18 @@ Main interface to problem statistics. sub BuildProblemStatisticsPage { my ($r,$c)=@_; # + my %Saveable_Parameters = ('Status' => 'scalar', + 'statsoutputmode' => 'scalar', + 'Section' => 'array', + 'StudentData' => 'array', + 'Maps' => 'array'); + &Apache::loncommon::store_course_settings('statistics', + \%Saveable_Parameters); + &Apache::loncommon::restore_course_settings('statistics', + \%Saveable_Parameters); + # + &Apache::lonstatistics::PrepareClasslist(); + # my ($interface,$output_mode,$show) = &CreateInterface(); $r->print($interface); $r->print(''); @@ -751,8 +763,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 +776,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) = @_; #