');
+ }
+ #
my $analysis_html;
- my $PerformanceData =
- &Apache::loncoursedata::get_response_data
- ($Students,$resource->{'symb'},$respid);
+ my $PerformanceData = &Apache::loncoursedata::get_response_data
+ (\@Apache::lonstatistics::SelectedSections,
+ $Apache::lonstatistics::enrollment_status,
+ $resource->{'symb'},$respid);
if (! defined($PerformanceData) ||
ref($PerformanceData) ne 'ARRAY' ) {
$analysis_html = '
'.
@@ -205,8 +219,10 @@ sub NumericalResponseAnalysis {
}
#
# This next call causes all the waiting around that people complain about
- my ($max,$min) = &Apache::lonstathelpers::GetStudentAnswers($r,$problem,
- $Students);
+ my ($max,$min) =
+ &Apache::lonstathelpers::GetStudentAnswers($r,$problem,$Students,
+ 'Statistics',
+ 'stats_status');
return if ($c->aborted());
#
# Collate the data
@@ -232,6 +248,9 @@ sub one_dimensional_plot {
# Compute data -> image scaling factors
my $min = $Labels->[0];
my $max = $Labels->[-1];
+ if ($max == $min) {
+ $max =$min+1;
+ }
my $h_scale = ($width-10)/($max-$min);
#
my $max_y = 0;
@@ -294,6 +313,17 @@ sub line {
return qq{$/};
}
+sub text {
+ my ($x,$y,$color,$text,$font,$direction) = @_;
+ if (! defined($font) || $font !~ /^(tiny|small|medium|large|giant)$/) {
+ $font = 'medium';
+ }
+ if (! defined($direction) || $direction ne 'vertical') {
+ $direction = '';
+ }
+ return qq{$text};
+}
+
sub rectangle {
my ($x1,$y1,$x2,$y2,$color,$thickness,$filled) = @_;
return qq{};
@@ -348,9 +378,10 @@ sub RadioResponseAnalysis {
my ($resource,$respid) = ($problem->{'resource'},
$problem->{'respid'});
my $analysis_html;
- my $PerformanceData =
- &Apache::loncoursedata::get_response_data
- ($Students,$resource->{'symb'},$respid);
+ my $PerformanceData = &Apache::loncoursedata::get_response_data
+ (\@Apache::lonstatistics::SelectedSections,
+ $Apache::lonstatistics::enrollment_status,
+ $resource->{'symb'},$respid);
if (! defined($PerformanceData) ||
ref($PerformanceData) ne 'ARRAY' ) {
$analysis_html = '
'.
@@ -533,9 +564,10 @@ sub OptionResponseAnalysis {
my ($resource,$respid) = ($problem->{'resource'},
$problem->{'respid'});
# Note: part data is not needed.
- my $PerformanceData =
- &Apache::loncoursedata::get_response_data
- ($Students,$resource->{'symb'},$respid);
+ my $PerformanceData = &Apache::loncoursedata::get_response_data
+ (\@Apache::lonstatistics::SelectedSections,
+ $Apache::lonstatistics::enrollment_status,
+ $resource->{'symb'},$respid);
if (! defined($PerformanceData) ||
ref($PerformanceData) ne 'ARRAY' ) {
$r->print('
'.
@@ -1279,18 +1311,18 @@ sub build_foil_index {
if (@Concepts > 1) {
$table .= '