[LON-CAPA-cvs] cvs: loncom /interface/statistics lonstudentsubmissions.pm

matthew lon-capa-cvs@mail.lon-capa.org
Fri, 12 Mar 2004 21:13:11 -0000


matthew		Fri Mar 12 16:13:11 2004 EDT

  Modified files:              
    /loncom/interface/statistics	lonstudentsubmissions.pm 
  Log:
  Check for aborted connections.
  
  
Index: loncom/interface/statistics/lonstudentsubmissions.pm
diff -u loncom/interface/statistics/lonstudentsubmissions.pm:1.7 loncom/interface/statistics/lonstudentsubmissions.pm:1.8
--- loncom/interface/statistics/lonstudentsubmissions.pm:1.7	Sun Mar  7 15:41:28 2004
+++ loncom/interface/statistics/lonstudentsubmissions.pm	Fri Mar 12 16:13:11 2004
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonstudentsubmissions.pm,v 1.7 2004/03/07 20:41:28 matthew Exp $
+# $Id: lonstudentsubmissions.pm,v 1.8 2004/03/12 21:13:11 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -163,6 +163,7 @@
 #########################################################
 sub prepare_excel_output {
     my ($r,$problem,$ProblemData,$Students) = @_;
+    my $c = $r->connection();
     my ($resource,$respid,$partid) = ($problem->{'resource'},
                                       $problem->{'respid'},
                                       $problem->{'part'});
@@ -209,6 +210,7 @@
     #
     # Populate the worksheet with the student data
     foreach my $student (@$Students) {
+        last if ($c->aborted());
         my $results = &Apache::loncoursedata::get_response_data_by_student
             ($student,$resource->{'symb'},$respid);
         my %row;
@@ -288,6 +290,7 @@
 
 sub GetStudentAnswers {
     my ($r,$problem,$Students) = @_;
+    my $c = $r->connection();
     my %Answers;
     my ($resource,$partid,$respid) = ($problem->{'resource'},
                                       $problem->{'part'},
@@ -299,6 +302,7 @@
     $r->print("<table>\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
@@ -307,6 +311,7 @@
                                                  &mt('last student'));
         $student->{'answer'} = $answer;
     }
+    return if ($c->aborted());
     $r->print("</table>\n");
     $r->rflush();
     # close progress window