--- loncom/interface/statistics/lonstudentsubmissions.pm 2004/03/16 16:30:32 1.9 +++ 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.9 2004/03/16 16:30:32 matthew Exp $ +# $Id: lonstudentsubmissions.pm,v 1.10 2004/03/16 16:41:26 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -153,7 +153,6 @@ sub BuildStudentSubmissionsPage { } } - ######################################################### ######################################################### ## @@ -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', @@ -288,38 +287,6 @@ sub prepare_excel_output { '

'."\n"); } -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->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 - ($resource,$sname,$sdom,$partid,$respid); - &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state, - &mt('last student')); - $student->{'answer'} = $answer; - } - &Apache::lonstathelpers::write_answer_cache(); - return if ($c->aborted()); - $r->rflush(); - # close progress window - &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); - return; -} - ######################################################### ######################################################### ##