--- loncom/interface/statistics/lonproblemanalysis.pm 2005/03/11 21:14:41 1.117
+++ loncom/interface/statistics/lonproblemanalysis.pm 2005/03/15 00:51:43 1.119
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonproblemanalysis.pm,v 1.117 2005/03/11 21:14:41 matthew Exp $
+# $Id: lonproblemanalysis.pm,v 1.119 2005/03/15 00:51:43 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -132,6 +132,7 @@ sub BuildProblemAnalysisPage {
my $resource = $current_problem->{'resource'};
$r->print('
'.$resource->compTitle.'
');
$r->print(''.$resource->src.'
');
+ $r->print(''.&Apache::lonstatistics::section_and_enrollment_description().'
');
if ($ENV{'form.show_prob'} eq 'true') {
$r->print(&Apache::lonstathelpers::render_resource($resource));
}
@@ -186,7 +187,7 @@ sub numerical_response_analysis {
$problem->{'respid'});
# Gather student data
my $response_data = &Apache::loncoursedata::get_response_data
- (\@Apache::lonstatistics::SelectedSections,
+ ([&Apache::lonstatistics::get_selected_sections()],
$Apache::lonstatistics::enrollment_status,
$resource->symb,$respid);
#
@@ -481,8 +482,12 @@ sub numerical_classify_responses {
if ($stats{'max_abs'} < $abs_high) {
$stats{'max_abs'} = $abs_high;
}
- my $low_percent = 100 * abs($abs_low / $subm{'correct'});
- my $high_percent = 100 * abs($abs_high / $subm{'correct'});
+ my $low_percent;
+ my $high_percent;
+ if (defined($subm{'correct'}) && $subm{'correct'} != 0) {
+ $low_percent = 100 * abs($abs_low / $subm{'correct'});
+ $high_percent = 100 * abs($abs_high / $subm{'correct'});
+ }
if (! defined($stats{'min_percent'}) ||
$stats{'min_percent'} > $low_percent) {
$stats{'min_percent'} = $low_percent;
@@ -530,6 +535,8 @@ sub numerical_classify_responses {
}
}
}
+ $stats{'correct_count'} |= 0;
+ $stats{'incorrect_count'} |= 0;
$stats{'students'}=scalar(keys(%students));
return (\%submission_data,\%stats);
}
@@ -765,7 +772,7 @@ sub radio_response_analysis {
$analysis_html .= $table;
# Gather student data
my $response_data = &Apache::loncoursedata::get_response_data
- (\@Apache::lonstatistics::SelectedSections,
+ ([&Apache::lonstatistics::get_selected_sections()],
$Apache::lonstatistics::enrollment_status,
$resource->symb,$respid);
my $correct; # either a hash reference or a scalar
@@ -881,16 +888,14 @@ sub radio_response_analysis {
$choice_plot ne '' ||
$stacked_plot ne '') {
my $correct = $foil_choice_data->{'_correct'};
- if (! defined($correct) || $correct eq '') {
- $correct = 0;
- }
- my $incorrect =
+ $correct |= 0;
+ my $incorrect = $foil_choice_data->{'_count'}-$correct;
$analysis_html.= ''.
''.
&mt($pre_graph_text,
$plot_num,$foil_choice_data->{'_count'},
$correct,
- $foil_choice_data->{'_count'}-$correct,
+ $incorrect,
$foil_choice_data->{'_students'},
@extra_data).
' |
'.$/;
@@ -1172,7 +1177,7 @@ sub OptionResponseAnalysis {
$problem->{'respid'});
# Note: part data is not needed.
my $PerformanceData = &Apache::loncoursedata::get_response_data
- (\@Apache::lonstatistics::SelectedSections,
+ ([&Apache::lonstatistics::get_selected_sections()],
$Apache::lonstatistics::enrollment_status,
$resource->symb,$respid);
if (! defined($PerformanceData) ||
@@ -1308,7 +1313,7 @@ sub OR_tries_analysis {
# Create Foil Plots
my $data_count = $response_data{'_total'}->[$try];
my $correct = $response_data{'_correct'}->[$try];
- if (! defined($correct)) { $correct = 0; }
+ $correct |= 0;
my @Datasets;
foreach my $option ('_correct',@{$ORdata->{'_Options'}}) {
next if (! exists($foil_plot[$try]->{$option}));
@@ -1471,6 +1476,7 @@ sub OR_time_analysis {
##
my ($processed_time_data,$correct,$data_count,$student_count) =
&OR_time_process_data($performance_data,$begin_index,$end_index);
+ $correct |= 0;
##
$table .= ''.
&mt('[_1] submissions from [_2] students, [_3] correct, [_4] incorrect',
|