--- loncom/interface/statistics/lonproblemanalysis.pm 2004/03/12 20:29:48 1.78
+++ loncom/interface/statistics/lonproblemanalysis.pm 2004/03/16 16:30:31 1.80
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonproblemanalysis.pm,v 1.78 2004/03/12 20:29:48 matthew Exp $
+# $Id: lonproblemanalysis.pm,v 1.80 2004/03/16 16:30:31 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -160,13 +160,8 @@ sub BuildProblemAnalysisPage {
$ProblemData,
\@Students);
} elsif ($current_problem->{'resptype'} eq 'numerical') {
-# if (exists($ENV{'form.ExcelOutput'})) {
-# &Apache::lonstudentsubmissions::prepare_excel_output
-# ($r,$current_problem,$ProblemData,\@Students);
-# } else {
&NumericalResponseAnalysis($r,$current_problem,
$ProblemData,\@Students);
-# }
} else {
$r->print('
This analysis is not supported
');
}
@@ -192,8 +187,10 @@ sub BuildProblemAnalysisPage {
#########################################################
sub NumericalResponseAnalysis {
my ($r,$problem,$ProblemData,$Students) = @_;
+ my $c = $r->connection();
my ($resource,$respid) = ($problem->{'resource'},
$problem->{'respid'});
+ $r->print('Response '.$respid.'');
my $analysis_html;
my $PerformanceData =
&Apache::loncoursedata::get_response_data
@@ -209,6 +206,7 @@ sub NumericalResponseAnalysis {
#
# This next call causes all the waiting around that people complain about
my ($max,$min) = &GetStudentAnswers($r,$problem,$Students);
+ return if ($c->aborted());
#
# Collate the data
my %Data;
@@ -312,17 +310,20 @@ sub circle {
sub GetStudentAnswers {
my ($r,$problem,$Students) = @_;
+ my $c = $r->connection();
my %Answers;
my ($resource,$partid,$respid) = ($problem->{'resource'},
$problem->{'part'},
$problem->{'respid'});
+ # Read in the cache (if it exists) before we start timing things.
+ &Apache::lonstathelpers::ensure_proper_cache($resource->{'symb'});
# Open progress window
my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin
($r,'Student Answer Compilation Status',
'Student Answer Compilation Progress', scalar(@$Students));
- $r->print("\n");
$r->rflush();
foreach my $student (@$Students) {
+ last if ($c->aborted());
my $sname = $student->{'username'};
my $sdom = $student->{'domain'};
my $answer = &Apache::lonstathelpers::analyze_problem_as_student
@@ -331,7 +332,8 @@ sub GetStudentAnswers {
&mt('last student'));
$student->{'answer'} = $answer;
}
- $r->print("
\n");
+ &Apache::lonstathelpers::write_answer_cache();
+ return if ($c->aborted());
$r->rflush();
# close progress window
&Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state);