');
- $r->print(&Apache::lonstathelpers::ProblemSelector
- ($problem_types));
+ $r->print(&Apache::lonstathelpers::problem_selector($problem_types,
+ $submit_button));
}
}
@@ -178,7 +200,7 @@ sub numerical_response_analysis {
my ($r,$problem,$problem_analysis,$students) = @_;
my $c = $r->connection();
#
- if ($ENV{'form.AnalyzeOver'} !~ /^(tries|time)$/) {
+ if ($env{'form.AnalyzeOver'} !~ /^(tries|time)$/) {
$r->print('Bad request');
}
#
@@ -187,9 +209,10 @@ 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::get_selected_groups()],
$Apache::lonstatistics::enrollment_status,
- $resource->{'symb'},$respid);
+ $resource->symb,$respid);
#
$problem_analysis->{'answercomputed'} = 1;
if ($problem_analysis->{'answercomputed'}) {
@@ -201,26 +224,27 @@ sub numerical_response_analysis {
}
#
if (ref($response_data) ne 'ARRAY') {
- $r->print('
'.
- &mt('There is no submission data for this resource').
- '
');
+ $r->print('
'
+ .&mt('There is no submission data for this resource.')
+ .'
'
+ );
return;
}
my $analysis_html = '
';
- for (my $plot_num = 1;$plot_num<=$ENV{'form.NumPlots'};$plot_num++) {
+ for (my $plot_num = 1;$plot_num<=$env{'form.NumPlots'};$plot_num++) {
my $restriction_function;
my $header_message;
my $stats_message;
my $post_message; # passed through &mt sooner rather than later
my $no_data_message;
my @extra_data;
- if ($ENV{'form.AnalyzeOver'} eq 'tries') {
+ if ($env{'form.AnalyzeOver'} eq 'tries') {
$restriction_function = sub {($_[0]->{'tries'} == $plot_num?1:0)};
$header_message = 'Attempt [_1]';
$stats_message =
'[_1] submissions, [_2] correct, [_3] incorrect';
$post_message = '';
- $no_data_message = 'No data exists for attempt [_1]';
+ $no_data_message = 'No data exists for attempt [_1].';
} else {
my $starttime = &Apache::lonhtmlcommon::get_date_from_form
('startdate_'.$plot_num);
@@ -268,9 +292,9 @@ sub numerical_response_analysis {
$restriction_function);
if ($stats->{'submission_count'} == 0) {
$analysis_html.=
- '
'.
- &mt('The analysis you have selected is '.
- 'not supported at this time').
- '
');
+ $r->print('div class="LC_warning"'
+ .&mt('The analysis you have selected is not supported at this time.')
+ .''
+ );
}
}
}
@@ -1211,7 +1266,7 @@ sub OptionResponseAnalysis {
sub OR_tries_analysis {
my ($r,$PerformanceData,$ORdata) = @_;
my $mintries = 1;
- my $maxtries = $ENV{'form.NumPlots'};
+ my $maxtries = $env{'form.NumPlots'};
my ($table,$Foils,$Concepts) = &build_foil_index($ORdata);
if (! defined($Concepts)) {
$Concepts = [];
@@ -1275,12 +1330,18 @@ sub OR_tries_analysis {
if (! defined($response_data{'_total'}->[$try]) ||
$response_data{'_total'}->[$try] == 0) {
if ($try > 1) {
- $analysis_html.= '
'.
- &mt('None of the selected students attempted the problem more than [_1] times.',$try-1).
- '
';
+ $analysis_html.= '
'
+ .'
'
+ .&mt('None of the selected students attempted the problem more than [_1] times.'
+ ,$try-1)
+ .'
'
+ .'
';
} else {
- $analysis_html.= '
'.
- &mt('None of the selected students have attempted the problem').'
';
+ $analysis_html.= '
'
+ .'
'
+ .&mt('None of the selected students have attempted the problem.')
+ .'
'
+ .'
';
}
last;
}
@@ -1309,6 +1370,7 @@ sub OR_tries_analysis {
# Create Foil Plots
my $data_count = $response_data{'_total'}->[$try];
my $correct = $response_data{'_correct'}->[$try];
+ $correct |= 0;
my @Datasets;
foreach my $option ('_correct',@{$ORdata->{'_Options'}}) {
next if (! exists($foil_plot[$try]->{$option}));
@@ -1420,7 +1482,7 @@ sub OR_time_analysis {
''.$table;
}
#
- my $num_plots = $ENV{'form.NumPlots'};
+ my $num_plots = $env{'form.NumPlots'};
my $num_data = scalar(@$performance_data)-1;
#
my $current_index;
@@ -1471,6 +1533,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',
@@ -1506,7 +1569,11 @@ sub OR_Foil_Time_Analysis {
my ($processed_time_data,$correct,$data_count,$student_count,
$ORdata,$Foils,$Concepts) = @_;
if ($data_count <= 0) {
- return ('
'.&mt('There is no data to plot').'
','');
+ return ('
'
+ .&mt('There is no data to plot.')
+ .'
'
+ ,''
+ );
}
my $analysis_html;
my @plotdata;
@@ -1682,23 +1749,23 @@ sub build_foil_index {
}
#
# Build up the table of row labels.
- my $table = '
'."\n";
+ my $table = &Apache::loncommon::start_data_table();
if (@Concepts > 1) {
- $table .= '