--- loncom/interface/statistics/lonstudentsubmissions.pm 2004/03/16 16:41:26 1.10 +++ loncom/interface/statistics/lonstudentsubmissions.pm 2004/08/31 15:52:13 1.14 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstudentsubmissions.pm,v 1.10 2004/03/16 16:41:26 matthew Exp $ +# $Id: lonstudentsubmissions.pm,v 1.14 2004/08/31 15:52:13 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('

There are no students in the sections selected

'); } # - &Apache::loncoursedata::clear_internal_caches(); - if (exists($ENV{'form.ClearCache'}) || - exists($ENV{'form.updatecaches'}) || - (exists($ENV{'form.firstanalysis'}) && - $ENV{'form.firstanalysis'} ne 'no')) { - &Apache::lonstatistics::Gather_Full_Student_Data($r); - } - if (! exists($ENV{'form.firstanalysis'})) { - $r->print(''); - } else { - $r->print(''); - } + my @CacheButtonHTML = + &Apache::lonstathelpers::manage_caches($r,'Statistics','stats_status'); $r->rflush(); # if (exists($ENV{'form.problemchoice'}) && @@ -100,6 +86,9 @@ sub BuildStudentSubmissionsPage { $r->print(' 'x5); } } + foreach my $html (@CacheButtonHTML) { + $r->print($html.(' 'x5)); + } # $r->print('
'); $r->rflush(); @@ -168,15 +157,35 @@ sub prepare_excel_output { $problem->{'part'}); $r->print('

'. &mt('Preparing Excel spreadsheet of student responses'). - '

'); - # - &Apache::lonstathelpers::GetStudentAnswers($r,$problem,$Students); + ''. + '

'. + &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'); + my $awarded_col = $#Columns; + push(@Columns,'weight'); + my $weight_col = $#Columns; + push(@Columns,'score'); # # Create excel worksheet my $filename = '/prtspool/'. @@ -215,7 +224,7 @@ sub prepare_excel_output { 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); @@ -285,6 +294,12 @@ sub prepare_excel_output { $r->print('

'. &mt('Your Excel spreadsheet.'). '

'."\n"); + $r->print(''); + $r->rflush(); + } ######################################################### @@ -300,14 +315,14 @@ sub CreateInterface { my $Str = ''; $Str .= &Apache::lonhtmlcommon::breadcrumbs (undef,'Student Submission Reports'); + $Str .= '

'; $Str .= ''."\n"; $Str .= ''; $Str .= ''; $Str .= ''; - $Str .= ''; + $Str .= ''; $Str .= ''."\n"; - ## - ## + # $Str .= ''; @@ -316,26 +331,22 @@ sub CreateInterface { $Str .= &Apache::lonhtmlcommon::StatusOptions(undef,undef,5); $Str .= ''; # - $Str .= ''; + my $checkbox = ''. + &mt('compute correct answers [_1]',$checkbox).''.''; # - my $only_seq_with_assessments = sub { - my $s=shift; - if ($s->{'num_assess'} < 1) { - return 0; - } else { - return 1; - } - }; - ## - ## $Str .= ''."\n"; $Str .= '
'.&mt('Sections').''.&mt('Enrollment Status').'  
'."\n"; $Str .= &Apache::lonstatistics::SectionSelect('Section','multiple',5); $Str .= '
'."\n"; # - # We do this to make sure the sequence information is initialized - &Apache::lonstatistics::MapSelect('Maps','multiple,all',5, - $only_seq_with_assessments); - - # + $Str .= ''.&mt('Status: [_1]', + ''). + ''.'

'; + ## return $Str; }