');
+ my ($starttime,$endtime) = &Apache::lonstathelpers::get_time_limits();
+ if (defined($starttime) || defined($endtime)) {
+ # Inform the user what the time limits on the data are.
+ $r->print(&mt('Statistics on submissions from [_1] to [_2]',
+ &Apache::lonlocal::locallocaltime($starttime),
+ &Apache::lonlocal::locallocaltime($endtime)));
+ }
+ &Apache::loncoursedata::populate_weight_table();
my $score_data = &Apache::loncoursedata::get_student_scores
- (\@Apache::lonstatistics::SelectedSections,
+ ([&Apache::lonstatistics::get_selected_sections()],
+ [&Apache::lonstatistics::get_selected_groups()],
\@ProblemSymbs,
- $Apache::lonstatistics::enrollment_status);
- $r->print(&AnalyzeScoreData($score_data));
+ $Apache::lonstatistics::enrollment_status,undef,
+ $starttime,$endtime);
+ $r->print(&AnalyzeScoreData($score_data,$title,$total_weights));
+ } else {
+ $r->print('
'.&mt('Make a sequence selection from the "Sequences and Folders" menu and hit "Create Plot" to begin').'
');
}
return;
}
@@ -138,11 +166,11 @@ return html with a plot of the data and
#########################################################
#########################################################
sub AnalyzeScoreData {
- my ($score_data) = @_;
+ my ($score_data,$title,$maximum) = @_;
#
# Basic check first
- if (@$score_data < 1) {
- return '
There is no data to plot
';
+ if (ref($score_data) ne 'ARRAY' || @$score_data < 1) {
+ return '
'.&mt('There is no data to plot').'
';
}
#
# Determine which bins to use
@@ -160,10 +188,16 @@ sub AnalyzeScoreData {
# Get the data into the bins (destroying $score_data in the process)
my @Bins = &bin_data($score_data,$binsize,$lowest,$highest);
my @Xdata; my @Ydata; my $max;
- my $Str = '
'."\n".'
Range
Count
'."\n";
+ my $Str =
+ '
'.
+ &mt('Problem weights do not reflect individual student settings.')
+ .'
'.
+ '
'."\n".'
Range
Count
'."\n";
+ my $sum = 0;
while (my $bin = shift(@Bins)) {
push (@Xdata,$bin->{'start'});
push (@Ydata,$bin->{'count'});
+ $sum += $bin->{'count'};
if ($bin->{'count'} > $max) {
$max = $bin->{'count'};
}
@@ -172,16 +206,16 @@ sub AnalyzeScoreData {
}
# scale max to an integer.
$max = 5*(int($max/5)+1);
- my $title = 'Correct Problems Plot';
$Str .= "