Diff for /loncom/interface/statistics/lonproblemstatistics.pm between versions 1.86 and 1.89

version 1.86, 2004/05/18 18:12:19 version 1.89, 2004/06/16 16:22:52
Line 263  my @Fields = ( Line 263  my @Fields = (
              graphable => 'yes',               graphable => 'yes',
              long_title => 'Degree of Discrimination',               long_title => 'Degree of Discrimination',
              selectable => 'yes',               selectable => 'yes',
              defaultselected => 'no',               defaultselected => 'yes',
            },             },
 ##   duedate included for research purposes.  Commented out most of the time.  ##   duedate included for research purposes.  Commented out most of the time.
 #           { name => 'duedate',  #           { name => 'duedate',
Line 547  select sections, maps, and output. Line 547  select sections, maps, and output.
 ###############################################  ###############################################
 ###############################################  ###############################################
 sub CreateInterface {  sub CreateInterface {
       my ($r) = @_;
     #      #
     &parse_field_selection();      &parse_field_selection();
     #      #
Line 582  sub CreateInterface { Line 583  sub CreateInterface {
     $Str .= '</td><td>'.&field_selection_input();      $Str .= '</td><td>'.&field_selection_input();
     $Str .= '</td></tr>'."\n";      $Str .= '</td></tr>'."\n";
     $Str .= '</table>'."\n";      $Str .= '</table>'."\n";
       #
       $Str .= '<p>'.&mt('Status: [_1]',
                            '<input type="text" '.
                            'name="stats_status" size="60" value="" />'
                            ).
                            '</nobr></p>';
       #
     $Str .= '<input type="submit" name="GenerateStatistics" value="'.      $Str .= '<input type="submit" name="GenerateStatistics" value="'.
         &mt('Generate Statistics').'" />';          &mt('Generate Statistics').'" />';
     $Str .= '&nbsp;'x5;      $Str .= '&nbsp;'x5;
     $Str .= 'Plot '.&plot_dropdown().('&nbsp;'x10);      $Str .= 'Plot '.&plot_dropdown().('&nbsp;'x10);
     $Str .= '<input type="submit" name="ClearCache" value="'.      #
         &mt('Clear Caches').'" />';  
     $Str .= '&nbsp;'x5;  
     $Str .= '<input type="submit" name="UpdateCache" value="'.  
         &mt('Update Student Data').'" />';  
     $Str .= '&nbsp;'x5;  
     $Str .= '<input type="submit" name="Excel" value="'.  
         &mt('Produce Excel Output').'" />';  
     $Str .= '&nbsp;'x5;  
     return $Str;      return $Str;
 }  }
   
Line 632  sub BuildProblemStatisticsPage { Line 632  sub BuildProblemStatisticsPage {
     undef(%SeqStat);      undef(%SeqStat);
     #      #
     # Finally let the user know we are here      # Finally let the user know we are here
     my $interface = &CreateInterface();      my $interface = &CreateInterface($r);
     $r->print($interface);      $r->print($interface);
     $r->print('<input type="hidden" name="sortby" value="'.$ENV{'form.sortby'}.      $r->print('<input type="hidden" name="sortby" value="'.$ENV{'form.sortby'}.
               '" />');                '" />');
     #      #
     if (! exists($ENV{'form.statsfirstcall'})) {      my @CacheButtonHTML = 
         $r->print('<input type="hidden" name="statsfirstcall" value="yes" />');          &Apache::lonstathelpers::manage_caches($r,'Statistics','stats_status');
       my $Str;
       foreach my $html (@CacheButtonHTML) {
           $Str.=$html.('&nbsp;'x5);
       }
       #
       $r->print($Str);
       if (! exists($ENV{'form.firstrun'})) {
         $r->print('<h3>'.          $r->print('<h3>'.
                   &mt('Press "Generate Statistics" when you are ready.').                    &mt('Press "Generate Statistics" when you are ready.').
                   '</h3><p>'.                    '</h3><p>'.
Line 647  sub BuildProblemStatisticsPage { Line 654  sub BuildProblemStatisticsPage {
                       ' will not have this delay.').                        ' will not have this delay.').
                   '</p>');                    '</p>');
         return;          return;
     } elsif ($ENV{'form.statsfirstcall'} eq 'yes' ||   
              exists($ENV{'form.UpdateCache'}) ||  
              exists($ENV{'form.ClearCache'}) ) {  
         $r->print('<input type="hidden" name="statsfirstcall" value="no" />');  
         &Apache::lonstatistics::Gather_Student_Data($r);  
     } else {  
         $r->print('<input type="hidden" name="statsfirstcall" value="no" />');  
     }      }
     $r->rflush();      $r->rflush();
     #      #
Line 663  sub BuildProblemStatisticsPage { Line 663  sub BuildProblemStatisticsPage {
     #      #
     if (exists($ENV{'form.Excel'})) {      if (exists($ENV{'form.Excel'})) {
         &Excel_output($r);          &Excel_output($r);
     } else {      } else { 
           $r->print('<input type="submit" name="Excel" value="'.
                     &mt('Produce Excel Output').'" />'.'&nbsp;'x5);
           $r->rflush();
         my $count = 0;          my $count = 0;
         foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) {          foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) {
             $count += $seq->{'num_assess_parts'};              $count += $seq->{'num_assess_parts'};
Line 1384  sub compute_statistics_on_sequence { Line 1387  sub compute_statistics_on_sequence {
     foreach my $res (@{$seq->{'contents'}}) {      foreach my $res (@{$seq->{'contents'}}) {
         next if ($res->{'type'} ne 'assessment');          next if ($res->{'type'} ne 'assessment');
         foreach my $part (@{$res->{'parts'}}) {          foreach my $part (@{$res->{'parts'}}) {
               next if ($res->{'partdata'}->{$part}->{'Survey'});
             #              #
             # This is where all the work happens              # This is where all the work happens
             my $data = &get_statistics($seq,$res,$part,scalar(@StatsArray)+1);              my $data = &get_statistics($seq,$res,$part,scalar(@StatsArray)+1);

Removed from v.1.86  
changed lines
  Added in v.1.89


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