Diff for /loncom/interface/statistics/lonstudentsubmissions.pm between versions 1.8 and 1.12

version 1.8, 2004/03/12 21:13:11 version 1.12, 2004/06/25 20:43:33
Line 43  my @SubmitButtons = ({ name => 'PrevProb Line 43  my @SubmitButtons = ({ name => 'PrevProb
                      { name => 'NextProblem',                       { name => 'NextProblem',
                        text => 'Next Problem' },                         text => 'Next Problem' },
                      { name => 'break'},                       { name => 'break'},
                      { name => 'ClearCache',  
                        text => 'Clear Caches' },  
                      { name => 'updatecaches',  
                        text => 'Update Student Data' },  
                      { name => 'SelectAnother',                       { name => 'SelectAnother',
                        text => 'Choose a different Problem' },                         text => 'Choose a different Problem' },
                      { name => 'Generate',                       { name => 'Generate',
Line 75  sub BuildStudentSubmissionsPage { Line 71  sub BuildStudentSubmissionsPage {
         $r->print('<h2>There are no students in the sections selected</h2>');          $r->print('<h2>There are no students in the sections selected</h2>');
     }      }
     #      #
     &Apache::loncoursedata::clear_internal_caches();      my @CacheButtonHTML = 
     if (exists($ENV{'form.ClearCache'}) ||           &Apache::lonstathelpers::manage_caches($r,'Statistics','stats_status');
         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('<input type="hidden" name="firstanalysis" value="yes" />');  
     } else {  
         $r->print('<input type="hidden" name="firstanalysis" value="no" />');  
     }  
     $r->rflush();      $r->rflush();
     #      #
     if (exists($ENV{'form.problemchoice'}) &&       if (exists($ENV{'form.problemchoice'}) && 
Line 100  sub BuildStudentSubmissionsPage { Line 86  sub BuildStudentSubmissionsPage {
                 $r->print('&nbsp;'x5);                  $r->print('&nbsp;'x5);
             }              }
         }          }
           foreach my $html (@CacheButtonHTML) {
               $r->print($html.('&nbsp;'x5));
           }
         #          #
         $r->print('<hr />');          $r->print('<hr />');
         $r->rflush();          $r->rflush();
Line 153  sub BuildStudentSubmissionsPage { Line 142  sub BuildStudentSubmissionsPage {
     }      }
 }  }
   
   
 #########################################################  #########################################################
 #########################################################  #########################################################
 ##  ##
Line 169  sub prepare_excel_output { Line 157  sub prepare_excel_output {
                                       $problem->{'part'});                                        $problem->{'part'});
     $r->print('<h2>'.      $r->print('<h2>'.
               &mt('Preparing Excel spreadsheet of student responses').                &mt('Preparing Excel spreadsheet of student responses').
               '</h2>');                '</h2>'.
     #                '<p>'.
     &GetStudentAnswers($r,$problem,$Students);                &mt('See the status bar above for student answer computation progress').
     #                '</p>');
       #
       &Apache::lonstathelpers::GetStudentAnswers($r,$problem,$Students,
                                                  'Statistics','stats_status');
       #
       $r->print('<script>'.
                 'window.document.Statistics.stats_status.value="'.
                 'Done computing student answers.  Compiling spreadsheet.'.
                 '";</script>');
       $r->rflush();
     my @Columns = ( 'username','domain','attempt','time',      my @Columns = ( 'username','domain','attempt','time',
                     'submission','correct', 'grading','awarded','weight',                      'submission','correct', 'grading','awarded','weight',
                     'score');                      'score');
Line 286  sub prepare_excel_output { Line 283  sub prepare_excel_output {
     $r->print('<p><a href="'.$filename.'">'.      $r->print('<p><a href="'.$filename.'">'.
               &mt('Your Excel spreadsheet.').                &mt('Your Excel spreadsheet.').
               '</a></p>'."\n");                '</a></p>'."\n");
 }      $r->print('<script>'.
                 'window.document.Statistics.stats_status.value="'.
 sub GetStudentAnswers {                'Done compiling spreadsheet.  See link below to download.'.
     my ($r,$problem,$Students) = @_;                '";</script>');
     my $c = $r->connection();  
     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("<table>\n");  
     $r->rflush();      $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;  
     }  
     return if ($c->aborted());  
     $r->print("</table>\n");  
     $r->rflush();  
     # close progress window  
     &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state);  
     return;  
 }  
   
   }
   
 #########################################################  #########################################################
 #########################################################  #########################################################
Line 333  sub CreateInterface { Line 304  sub CreateInterface {
     my $Str = '';      my $Str = '';
     $Str .= &Apache::lonhtmlcommon::breadcrumbs      $Str .= &Apache::lonhtmlcommon::breadcrumbs
         (undef,'Student Submission Reports');          (undef,'Student Submission Reports');
       $Str .= '<p>';
     $Str .= '<table cellspacing="5">'."\n";      $Str .= '<table cellspacing="5">'."\n";
     $Str .= '<tr>';      $Str .= '<tr>';
     $Str .= '<td align="center"><b>'.&mt('Sections').'</b></td>';      $Str .= '<td align="center"><b>'.&mt('Sections').'</b></td>';
     $Str .= '<td align="center"><b>'.&mt('Enrollment Status').'</b></td>';      $Str .= '<td align="center"><b>'.&mt('Enrollment Status').'</b></td>';
     $Str .= '<td align="center">&nbsp;</td>';  
     $Str .= '</tr>'."\n";      $Str .= '</tr>'."\n";
     ##      #
     ##   
     $Str .= '<tr><td align="center">'."\n";      $Str .= '<tr><td align="center">'."\n";
     $Str .= &Apache::lonstatistics::SectionSelect('Section','multiple',5);      $Str .= &Apache::lonstatistics::SectionSelect('Section','multiple',5);
     $Str .= '</td>';      $Str .= '</td>';
Line 349  sub CreateInterface { Line 319  sub CreateInterface {
     $Str .= &Apache::lonhtmlcommon::StatusOptions(undef,undef,5);      $Str .= &Apache::lonhtmlcommon::StatusOptions(undef,undef,5);
     $Str .= '</td>';      $Str .= '</td>';
     #      #
     $Str .= '<td></td>';  
     #  
     my $only_seq_with_assessments = sub {   
         my $s=shift;  
         if ($s->{'num_assess'} < 1) {   
             return 0;  
         } else {   
             return 1;  
         }  
     };  
     ##  
     ##  
     $Str .= '</tr>'."\n";      $Str .= '</tr>'."\n";
     $Str .= '</table>'."\n";      $Str .= '</table>'."\n";
     #      #
     # We do this to make sure the sequence information is initialized      $Str .= '<nobr>'.&mt('Status: [_1]',
     &Apache::lonstatistics::MapSelect('Maps','multiple,all',5,                           '<input type="text" '.
                                               $only_seq_with_assessments);                           'name="stats_status" size="60" value="" />').
                   '</nobr>'.'</p>';    
     #      ##
     return $Str;      return $Str;
 }  }
   

Removed from v.1.8  
changed lines
  Added in v.1.12


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>