--- loncom/interface/statistics/lonproblemanalysis.pm 2004/01/08 19:20:12 1.53
+++ loncom/interface/statistics/lonproblemanalysis.pm 2004/01/16 15:33:40 1.54
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonproblemanalysis.pm,v 1.53 2004/01/08 19:20:12 matthew Exp $
+# $Id: lonproblemanalysis.pm,v 1.54 2004/01/16 15:33:40 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -42,8 +42,13 @@ my $plotcolors = ['#33ff00',
'#66ccff', '#ff9999', '#cccc33', '#660000', '#33cc66',
];
-my @SubmitButtons = ({ name => 'ProblemAnalyis',
+my @SubmitButtons = ({ name => 'PrevProblemAnalysis',
+ text => 'Previous Problem' },
+ { name => 'ProblemAnalysis',
text => 'Analyze Problem Again' },
+ { name => 'NextProblemAnalysis',
+ text => 'Next Problem' },
+ { name => 'break'},
{ name => 'ClearCache',
text => 'Clear Caches' },
{ name => 'updatecaches',
@@ -112,34 +117,57 @@ sub BuildProblemAnalysisPage {
if (exists($ENV{'form.problemchoice'}) &&
! exists($ENV{'form.SelectAnother'})) {
foreach my $button (@SubmitButtons) {
- $r->print('{'text'}).'" />');
- $r->print(' 'x5);
+ if ($button->{'name'} eq 'break') {
+ $r->print(" \n");
+ } else {
+ $r->print('{'text'}).'" />');
+ $r->print(' 'x5);
+ }
}
- $r->print('');
#
$r->print('
');
- #
- my ($symb,$part,$resid,$resptype) = &get_problem_symb(
- &Apache::lonnet::unescape($ENV{'form.problemchoice'}));
$r->rflush();
#
- my $resource = &get_resource_from_symb($symb);
- if (! defined($resource) || ! defined($resptype)) {
+ # Determine which problem we are to analyze
+ my $current_problem = &get_target_from_id($ENV{'form.problemchoice'});
+ #
+ my ($prev,$curr,$next) = &get_prev_curr_next($current_problem);
+ if (exists($ENV{'form.PrevProblemAnalysis'}) && defined($prev)) {
+ $current_problem = $prev;
+ } elsif (exists($ENV{'form.NextProblemAnalysis'}) && defined($next)) {
+ $current_problem = $next;
+ } else {
+ $current_problem = $curr;
+ }
+ #
+ # Store the current problem choice and send it out in the form
+ $ENV{'form.problemchoice'} = &make_target_id($current_problem);
+ $r->print('');
+ #
+ if (! defined($current_problem->{'resource'})) {
$r->print('resource is undefined');
} else {
+ my $resource = $current_problem->{'resource'};
$r->print('