');
- $r->print(&Apache::lonstathelpers::problem_selector('.'));
+ $r->print(&Apache::lonstathelpers::problem_selector('.',
+ $submit_button));
} else {
foreach my $button (@SubmitButtons) {
$r->print('rflush();
#
# Determine which problem we are to analyze
- my $current_problem = &Apache::lonstathelpers::get_target_from_id
- ($ENV{'form.problemchoice'});
- #
- my ($navmap,$prev,$curr,$next) =
- &Apache::lonstathelpers::get_prev_curr_next($current_problem,
- '.',
- 'part');
- if (exists($ENV{'form.PrevProblemAnalysis'}) && defined($prev)) {
- $current_problem = $prev;
- } elsif (exists($ENV{'form.NextProblemAnalysis'}) && defined($next)) {
- $current_problem = $next;
- } else {
- $current_problem = $curr;
- }
+ my ($navmap,$current_problem) = &get_current_problem(); # need to retrieve $navmap
+ # to support $resource->* calls
+ # for src and compTitle (below)
#
# Store the current problem choice and send it out in the form
- $ENV{'form.problemchoice'} =
+ $env{'form.problemchoice'} =
&Apache::lonstathelpers::make_target_id($current_problem);
$r->print('');
+ $env{'form.problemchoice'}.'" />');
#
$r->print('');
$r->rflush();
#
my $resource = $current_problem->{'resource'};
if (! defined($resource)) {
- $r->print('resource is undefined');
+ $r->print('
There is no submission data for this problem at all
';
+ $html.= '
'
+ .&mt('There is no submission data for this problem at all.')
+ .'
';
return $html;
}
my $NumSub = scalar(@{$SubData});
if (! @{$SubData}) {
- $html.= '
There is no submission data for this problem
';
+ $html.= '
'
+ .&mt('There is no submission data for this problem.')
+ .'
';
return $html;
}
# Process the data
@@ -199,7 +225,7 @@ sub analyze_times {
my @Ydata=(0); # number of submissions
my @AnsData=(0); # number of correct submissions
my @Xlabel=($WeekDay[$wday]); # Labels of itmes
- my @BinEnd; # The end time of each bin
+ my @BinEnd=($endtime); # The end time of each bin
my $cumulative_answers = 0; # The sum of @AnsData
my %students; # which students have attempted the problem?
#
@@ -211,7 +237,7 @@ sub analyze_times {
$Ydata[$bincount] = 0;
$AnsData[$bincount] = 0;
$endtime += $binsize;
- push(@BinEnd,$endtime);
+ $BinEnd[$bincount] = $endtime;
if ($bincount % (86400/$binsize) == 0) {
$wday++;
$wday %= 7;
@@ -233,7 +259,7 @@ sub analyze_times {
$Ydata[$bincount]=0;
$AnsData[$bincount]=0;
$endtime += $binsize;
- push(@BinEnd,$endtime);
+ $BinEnd[$bincount]=$endtime;
if ($bincount % (86400/$binsize) == 0) {
$wday ++;
$wday %= 7;
@@ -256,51 +282,48 @@ sub analyze_times {
}
#
# Build the data table
- $htmltable = '