--- loncom/interface/statistics/loncorrectproblemplot.pm 2005/03/01 22:25:59 1.15 +++ loncom/interface/statistics/loncorrectproblemplot.pm 2005/04/07 06:56:24 1.18 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: loncorrectproblemplot.pm,v 1.15 2005/03/01 22:25:59 matthew Exp $ +# $Id: loncorrectproblemplot.pm,v 1.18 2005/04/07 06:56:24 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -28,7 +28,7 @@ package Apache::loncorrectproblemplot; use strict; -use Apache::lonnet(); +use Apache::lonnet; use Apache::loncommon(); use Apache::lonhtmlcommon(); use Apache::loncoursedata(); @@ -90,9 +90,9 @@ sub BuildCorrectProblemsPage { $r->rflush(); # # Determine which problem symbs we are to sum over - if (exists($ENV{'form.CreatePlot'})) { + if (exists($env{'form.CreatePlot'})) { my @ProblemSymbs; - my $total_parts = 0; + my $total_weights = 0; my $title = ''; my @maps = &Apache::lonstatistics::get_selected_maps('Maps'); my ($navmap,@sequences) = @@ -104,26 +104,27 @@ sub BuildCorrectProblemsPage { } else { $title = 'Multiple Sequences'; } - my @resources = - &Apache::lonstathelpers::get_resources($navmap,$seq); - foreach my $res (@resources) { - foreach my $partid (@{$res->parts}) { - $total_parts++; - push(@ProblemSymbs,{symb=>$res->symb, - part=>$partid}); - } - } } } else { - $title = "All Problems"; - foreach my $seq (@sequences) { - my @resources = - &Apache::lonstathelpers::get_resources($navmap,$seq); - foreach my $res (@resources) { - $total_parts += scalar(@{$res->parts}); + $title = 'All Problems'; + } + foreach my $seq (@sequences) { + my @resources = + &Apache::lonstathelpers::get_resources($navmap,$seq); + foreach my $res (@resources) { + foreach my $partid (@{$res->parts}) { + push(@ProblemSymbs,{symb=>$res->symb, + part=>$partid}); + $total_weights += + &Apache::lonnet::EXT('resource.'.$partid.'.weight', + $res->symb, + undef,undef,undef); } } } + $r->print('
'. + &mt('Problem weights do not reflect individual student settings.') + .'
'. 'Range | Count |
---|
".&Apache::loncommon::DrawBarGraph($title.' N = '.$sum,
- 'Correct Problems (max possible = '.$total_parts.')',
- 'Number of students',
- $max,
- undef, # colors
- \@Xdata,
- \@Ydata).
- "\n
\n".$Str;
+ $Str = "\n
".
+ &Apache::loncommon::DrawBarGraph($title.' ('.$sum.' students)',
+ 'Correct Problems (max possible = '.$maximum.')',
+ 'Number of students',
+ $max,undef, # colors
+ \@Xdata,\@Ydata).
+ "\n
\n".$Str;
$Str .= '