--- loncom/interface/statistics/lonstudentsubmissions.pm 2004/02/19 20:17:01 1.1 +++ loncom/interface/statistics/lonstudentsubmissions.pm 2004/03/16 16:41:26 1.10 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstudentsubmissions.pm,v 1.1 2004/02/19 20:17:01 matthew Exp $ +# $Id: lonstudentsubmissions.pm,v 1.10 2004/03/16 16:41:26 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -67,7 +67,6 @@ sub BuildStudentSubmissionsPage { # &Apache::lonstatistics::PrepareClasslist(); # - $r->print('

'.&mt('Student Submissions Report').'

'); $r->print(&CreateInterface()); # my @Students = @Apache::lonstatistics::Students; @@ -154,7 +153,6 @@ sub BuildStudentSubmissionsPage { } } - ######################################################### ######################################################### ## @@ -164,6 +162,7 @@ sub BuildStudentSubmissionsPage { ######################################################### sub prepare_excel_output { my ($r,$problem,$ProblemData,$Students) = @_; + my $c = $r->connection(); my ($resource,$respid,$partid) = ($problem->{'resource'}, $problem->{'respid'}, $problem->{'part'}); @@ -171,7 +170,7 @@ sub prepare_excel_output { &mt('Preparing Excel spreadsheet of student responses'). ''); # - &GetStudentAnswers($r,$problem,$Students); + &Apache::lonstathelpers::GetStudentAnswers($r,$problem,$Students); # my @Columns = ( 'username','domain','attempt','time', 'submission','correct', 'grading','awarded','weight', @@ -210,6 +209,7 @@ sub prepare_excel_output { # # 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; @@ -287,36 +287,6 @@ sub prepare_excel_output { '

'."\n"); } -sub GetStudentAnswers { - my ($r,$problem,$Students) = @_; - my %Answers; - my ($resource,$partid,$respid) = ($problem->{'resource'}, - $problem->{'part'}, - $problem->{'respid'}); - # 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) { - my $sname = $student->{'username'}; - my $sdom = $student->{'domain'}; - my $answer = &Apache::lonstathelpers::analyze_problem_as_student - ($resource,$sname,$sdom,$partid,$respid); - &Apache::lonnet::logthis('answer = "'.$answer.'"'); - &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state, - &mt('last student')); - $student->{'answer'} = $answer; - } - $r->print("
\n"); - $r->rflush(); - # close progress window - &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); - return; -} - - ######################################################### ######################################################### ## @@ -328,6 +298,8 @@ sub CreateInterface { ## ## Environment variable initialization my $Str = ''; + $Str .= &Apache::lonhtmlcommon::breadcrumbs + (undef,'Student Submission Reports'); $Str .= ''."\n"; $Str .= ''; $Str .= ''; @@ -344,6 +316,8 @@ sub CreateInterface { $Str .= &Apache::lonhtmlcommon::StatusOptions(undef,undef,5); $Str .= ''; # + $Str .= ''; + # my $only_seq_with_assessments = sub { my $s=shift; if ($s->{'num_assess'} < 1) {
'.&mt('Sections').'