--- loncom/interface/statistics/loncorrectproblemplot.pm 2004/03/01 16:39:19 1.8 +++ loncom/interface/statistics/loncorrectproblemplot.pm 2004/03/07 20:53:41 1.9 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: loncorrectproblemplot.pm,v 1.8 2004/03/01 16:39:19 matthew Exp $ +# $Id: loncorrectproblemplot.pm,v 1.9 2004/03/07 20:53:41 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -103,22 +103,32 @@ sub BuildCorrectProblemsPage { # Determine which problem symbs we are to sum over if (exists($ENV{'form.CreatePlot'})) { my @ProblemSymbs; + my $total_parts = 0; + my $title = ''; if ($Apache::lonstatistics::SelectedMaps[0] ne 'all') { foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()){ + if ($title eq '') { + $title = $seq->{'title'}; + } else { + $title = 'Multiple Sequences'; + } foreach my $res (@{$seq->{'contents'}}) { next if ($res->{'type'} ne 'assessment'); foreach my $part (@{$res->{'parts'}}) { + $total_parts++; push(@ProblemSymbs,{symb=>$res->{'symb'}, part=>$part}); } } } } + my ($starttime,$endtime) = &Apache::lonstathelpers::get_time_limits(); my $score_data = &Apache::loncoursedata::get_student_scores (\@Apache::lonstatistics::SelectedSections, \@ProblemSymbs, - $Apache::lonstatistics::enrollment_status); - $r->print(&AnalyzeScoreData($score_data)); + $Apache::lonstatistics::enrollment_status,undef, + $starttime,$endtime); + $r->print(&AnalyzeScoreData($score_data,$title,$total_parts)); } return; } @@ -138,7 +148,7 @@ return html with a plot of the data and ######################################################### ######################################################### sub AnalyzeScoreData { - my ($score_data) = @_; + my ($score_data,$title,$total_parts) = @_; # # Basic check first if (@$score_data < 1) { @@ -149,6 +159,7 @@ sub AnalyzeScoreData { my $lowest = $score_data->[0]->[0]; $lowest = 0; my $highest = $score_data->[-1]->[0]; + &Apache::lonnet::logthis('highest = '.$highest); my $binsize = 1; if ($highest > 50) { $binsize = 2; } if ($highest > 100) { $binsize = 5; } @@ -161,9 +172,11 @@ sub AnalyzeScoreData { my @Bins = &bin_data($score_data,$binsize,$lowest,$highest); my @Xdata; my @Ydata; my $max; my $Str = '
Range | Count |
---|