--- loncom/interface/statistics/lonstudentsubmissions.pm 2004/03/01 16:39:19 1.5 +++ loncom/interface/statistics/lonstudentsubmissions.pm 2004/08/31 15:22:51 1.13 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstudentsubmissions.pm,v 1.5 2004/03/01 16:39:19 matthew Exp $ +# $Id: lonstudentsubmissions.pm,v 1.13 2004/08/31 15:22:51 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -43,10 +43,6 @@ my @SubmitButtons = ({ name => 'PrevProb { name => 'NextProblem', text => 'Next Problem' }, { name => 'break'}, - { name => 'ClearCache', - text => 'Clear Caches' }, - { name => 'updatecaches', - text => 'Update Student Data' }, { name => 'SelectAnother', text => 'Choose a different Problem' }, { name => 'Generate', @@ -75,18 +71,8 @@ sub BuildStudentSubmissionsPage { $r->print('
'. + &mt('See the status bar above for student answer computation progress'). + '
'); + # + if ($ENV{'form.correctans'} eq 'true') { + &Apache::lonstathelpers::GetStudentAnswers($r,$problem,$Students, + 'Statistics', + 'stats_status'); + } # - my @Columns = ( 'username','domain','attempt','time', - 'submission','correct', 'grading','awarded','weight', - 'score'); - my $awarded_col = 7; - my $weight_col = 8; + $r->print(''); + $r->rflush(); + my @Columns; + push(@Columns,'username'); + push(@Columns,'domain'); + push(@Columns,'attempt'); + push(@Columns,'time'); + push(@Columns,'submission'); + if ($ENV{'form.correctans'} eq 'true') { push(@Columns,'correct'); } + push(@Columns,'grading'); + push(@Columns,'awarded'); + push(@Columns,'weight'); + push(@Columns,'score'); + my ($awarded_col,$weight_col); + if ($ENV{'form.correctans'} eq 'true') { + $awarded_col = 7; + $weight_col = 8; + } else { + $awarded_col = 6; + $weight_col = 7; + } # # Create excel worksheet my $filename = '/prtspool/'. @@ -209,12 +224,13 @@ 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; $row{'username'} = $student->{'username'}; $row{'domain'} = $student->{'domain'}; - $row{'correct'} = $student->{'answer'}; + $row{'correct'} = $student->{'answer'}; $row{'weight'} = &Apache::lonnet::EXT ('resource.'.$partid.'.weight',$resource->{'symb'}, undef,undef,undef); @@ -284,36 +300,13 @@ sub prepare_excel_output { $r->print(''. &mt('Your Excel spreadsheet.'). '
'."\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("'; $Str .= '
'.&mt('Sections').' | '; $Str .= ''.&mt('Enrollment Status').' | '; - $Str .= ''; + $Str .= ' | '; $Str .= ' |
'."\n"; $Str .= &Apache::lonstatistics::SectionSelect('Section','multiple',5); $Str .= ' | '; @@ -344,24 +337,22 @@ sub CreateInterface { $Str .= &Apache::lonhtmlcommon::StatusOptions(undef,undef,5); $Str .= ''; # - my $only_seq_with_assessments = sub { - my $s=shift; - if ($s->{'num_assess'} < 1) { - return 0; - } else { - return 1; - } - }; - ## - ## + my $checkbox = ''. + &mt('compute correct answers [_1]',$checkbox).''.''; + # $Str .= '