');
- $r->print(&Apache::lonstathelpers::problem_selector($problem_types));
+ $r->print(&Apache::lonstathelpers::problem_selector($problem_types,
+ $submit_button));
}
}
@@ -177,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');
}
#
@@ -186,7 +209,8 @@ 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);
#
@@ -200,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);
@@ -267,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,12 +1266,11 @@ 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 = [];
}
- &Apache::lonnet::logthis('got '.scalar(@$PerformanceData).' data points');
my %response_data = &OR_analyze_by_tries($r,$PerformanceData,
$mintries,$maxtries);
my $analysis = '';
@@ -1273,16 +1327,21 @@ sub OR_tries_analysis {
if (defined($Concepts)) { $num_concepts = scalar(@$Concepts); }
#
for (my $try=$mintries;$try<=$maxtries;$try++) {
- &Apache::lonnet::logthis('try = '.$try);
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;
}
@@ -1307,18 +1366,16 @@ sub OR_tries_analysis {
('Correct Concepts','Concept Number','Percent Correct',
100,$plotcolors,undef,\@concept_plot_data,{xskip=>1});
}
- &Apache::lonnet::logthis('got here a_0');
#
# 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'}}) {
- &Apache::lonnet::logthis('checking option '.$option);
next if (! exists($foil_plot[$try]->{$option}));
push(@Datasets,$foil_plot[$try]->{$option});
}
- &Apache::lonnet::logthis('got here a');
#
# Put a blank in the data set between concepts
for (my $set =0;$set<=$#Datasets;$set++) {
@@ -1335,7 +1392,6 @@ sub OR_tries_analysis {
}
#
# Set up the labels needed for the bar graph
- &Apache::lonnet::logthis('got here b');
my @Labels;
my $idx = 1;
foreach my $concept (@{$Concepts}) {
@@ -1351,9 +1407,7 @@ sub OR_tries_analysis {
#
#
- &Apache::lonnet::logthis('got here c');
next if (! defined($Datasets[0]));
- &Apache::lonnet::logthis('got here d');
for (my $i=0; $i< scalar(@{$Datasets[0]});$i++) {
$Datasets[0]->[$i]=0;
}
@@ -1362,7 +1416,6 @@ sub OR_tries_analysis {
my $incorrect_graph = &Apache::loncommon::DrawBarGraph
('Incorrect Statements','Statement','% Chosen Incorrectly',
100,$plotcolors,\@Labels,@Datasets,{xskip=>1});
- &Apache::lonnet::logthis('incorrect graph = '.$incorrect_graph);
$analysis_html.=
'
'.
''.
@@ -1429,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;
@@ -1480,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',
@@ -1515,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;
@@ -1691,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 .= '