--- loncom/interface/statistics/loncorrectproblemplot.pm 2004/06/04 21:42:18 1.11 +++ loncom/interface/statistics/loncorrectproblemplot.pm 2004/12/10 20:41:39 1.14 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: loncorrectproblemplot.pm,v 1.11 2004/06/04 21:42:18 matthew Exp $ +# $Id: loncorrectproblemplot.pm,v 1.14 2004/12/10 20:41:39 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -110,6 +110,14 @@ sub BuildCorrectProblemsPage { } } } + } else { + $title = "All Problems"; + foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()){ + foreach my $res (@{$seq->{'contents'}}) { + next if ($res->{'type'} ne 'assessment'); + $total_parts += scalar(@{$res->{'parts'}}); + } + } } my ($starttime,$endtime) = &Apache::lonstathelpers::get_time_limits(); if (defined($starttime) || defined($endtime)) { @@ -148,15 +156,14 @@ sub AnalyzeScoreData { my ($score_data,$title,$total_parts) = @_; # # Basic check first - if (@$score_data < 1) { - return '

There is no data to plot

'; + if (ref($score_data) ne 'ARRAY' || @$score_data < 1) { + return '

'.&mt('There is no data to plot').'

'; } # # Determine which bins to use 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; } @@ -186,7 +193,7 @@ sub AnalyzeScoreData { $Str .= "
\n"; $title = &HTML::Entities::decode($title); $Str = "\n

".&Apache::loncommon::DrawBarGraph($title.' N = '.$sum, - 'Num Correct Problems (max:'.$total_parts.')', + 'Correct Problems (max possible = '.$total_parts.')', 'Number of students', $max, undef, # colors