');
my ($starttime,$endtime) = &Apache::lonstathelpers::get_time_limits();
if (defined($starttime) || defined($endtime)) {
# Inform the user what the time limits on the data are.
@@ -129,12 +137,16 @@ sub BuildCorrectProblemsPage {
&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,undef,
$starttime,$endtime);
- $r->print(&AnalyzeScoreData($score_data,$title,$total_parts));
+ $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;
}
@@ -154,18 +166,17 @@ return html with a plot of the data and
#########################################################
#########################################################
sub AnalyzeScoreData {
- my ($score_data,$title,$total_parts) = @_;
+ 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
my $lowest = $score_data->[0]->[0];
$lowest = 0;
my $highest = $score_data->[-1]->[0];
- &Apache::lonnet::logthis('highest = '.$highest);
my $binsize = 1;
if ($highest > 50) { $binsize = 2; }
if ($highest > 100) { $binsize = 5; }
@@ -177,7 +188,11 @@ 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'});
@@ -193,14 +208,14 @@ sub AnalyzeScoreData {
$max = 5*(int($max/5)+1);
$Str .= "