Diff for /loncom/interface/statistics/lonstathelpers.pm between versions 1.13 and 1.18

version 1.13, 2004/06/15 14:22:45 version 1.18, 2004/08/03 19:53:12
Line 109  all option response and radiobutton prob Line 109  all option response and radiobutton prob
   
 Returns: A string containing html for a table which lists the sequences  Returns: A string containing html for a table which lists the sequences
 and their contents.  A radiobutton is provided for each problem.  and their contents.  A radiobutton is provided for each problem.
   Skips 'survey' problems.
   
 =cut  =cut
   
Line 125  sub ProblemSelector { Line 126  sub ProblemSelector {
             next if ($res->{'type'} ne 'assessment');              next if ($res->{'type'} ne 'assessment');
             foreach my $part (@{$res->{'parts'}}) {              foreach my $part (@{$res->{'parts'}}) {
                 my $partdata = $res->{'partdata'}->{$part};                  my $partdata = $res->{'partdata'}->{$part};
                   next if ($partdata->{'Survey'});
                 for (my $i=0;$i<scalar(@{$partdata->{'ResponseTypes'}});$i++){                  for (my $i=0;$i<scalar(@{$partdata->{'ResponseTypes'}});$i++){
                     my $respid = $partdata->{'ResponseIds'}->[$i];                      my $respid = $partdata->{'ResponseIds'}->[$i];
                     my $resptype = $partdata->{'ResponseTypes'}->[$i];                      my $resptype = $partdata->{'ResponseTypes'}->[$i];
Line 260  sub get_prev_curr_next { Line 262  sub get_prev_curr_next {
             next if ($res->{'type'} ne 'assessment');              next if ($res->{'type'} ne 'assessment');
             foreach my $part (@{$res->{'parts'}}) {              foreach my $part (@{$res->{'parts'}}) {
                 my $partdata = $res->{'partdata'}->{$part};                  my $partdata = $res->{'partdata'}->{$part};
                 if ($granularity eq 'part_survey' && $partdata->{'Survey'}){                  if ($partdata->{'Survey'}) {
                     push (@Resource,                      if ($granularity eq 'part_survey'){
                           { symb     => $res->{symb},                          push (@Resource,
                             part     => $part,                                { symb     => $res->{symb},
                             resource => $res,                                  part     => $part,
                         } );                                  resource => $res,
                               } );
                       }
                 } elsif ($granularity eq 'part') {                  } elsif ($granularity eq 'part') {
                     push (@Resource,                      push (@Resource,
                           { symb     => $res->{symb},                            { symb     => $res->{symb},
Line 635  sub ensure_proper_cache { Line 639  sub ensure_proper_cache {
     my ($symb) = @_;      my ($symb) = @_;
     my $cid = $ENV{'request.course.id'};      my $cid = $ENV{'request.course.id'};
     my $new_filename =  '/home/httpd/perl/tmp/'.      my $new_filename =  '/home/httpd/perl/tmp/'.
         'problemanalsysis_'.$cid.'answer_cache.db';          'problemanalysis_'.$cid.'_answer_cache.db';
     if (! defined($cache_filename) ||      if (! defined($cache_filename) ||
         $cache_filename ne $new_filename ||          $cache_filename ne $new_filename ||
         ! defined($current_symb)   ||          ! defined($current_symb)   ||
Line 1069  Returns: An array of scalars containing Line 1073  Returns: An array of scalars containing
 sub manage_caches {  sub manage_caches {
     my ($r,$formname,$inputname) = @_;      my ($r,$formname,$inputname) = @_;
     &Apache::loncoursedata::clear_internal_caches();      &Apache::loncoursedata::clear_internal_caches();
       my $sectionkey = 
           join(',',
                map {
                        &Apache::lonnet::escape($_);
                    } sort(@Apache::lonstatistics::SelectedSections)
                );
       my $statuskey = $Apache::lonstatistics::enrollment_status;
     if (exists($ENV{'form.ClearCache'}) ||       if (exists($ENV{'form.ClearCache'}) || 
         exists($ENV{'form.updatecaches'}) ||          exists($ENV{'form.updatecaches'}) || 
         (exists($ENV{'form.firstrun'}) &&          (exists($ENV{'form.firstrun'}) && $ENV{'form.firstrun'} ne 'no') ||
          $ENV{'form.firstrun'} ne 'no')) {          (exists($ENV{'form.prevsection'}) &&
               $ENV{'form.prevsection'} ne $sectionkey) ||
           (exists($ENV{'form.prevenrollstatus'}) &&
               $ENV{'form.prevenrollstatus'} ne $statuskey)
           ) {
         &Apache::lonstatistics::Gather_Full_Student_Data($r,$formname,          &Apache::lonstatistics::Gather_Full_Student_Data($r,$formname,
                                                          $inputname);                                                           $inputname);
     }      }
     #      #
       my @Buttons = 
           ('<input type="submit" name="ClearCache" '.
                'value="'.&mt('Clear Caches').'" />',
            '<input type="submit" name="updatecaches" '.
                'value="'.&mt('Update Caches').'" />'.
            &Apache::loncommon::help_open_topic('Statistics_Cache'),
            '<input type="hidden" name="prevsection" value="'.$sectionkey.'" />',
            '<input type="hidden" name="prevenrollstatus" value="'.$statuskey.'" />'
            );
       #
     if (! exists($ENV{'form.firstrun'})) {      if (! exists($ENV{'form.firstrun'})) {
         $r->print('<input type="hidden" name="firstrun" value="yes" />');          $r->print('<input type="hidden" name="firstrun" value="yes" />');
     } else {      } else {
         $r->print('<input type="hidden" name="firstrun" value="no" />');          $r->print('<input type="hidden" name="firstrun" value="no" />');
     }      }
     my @Buttons =   
         ('<input type="submit" name="ClearCache" '.  
              'value="'.&mt('Clear Caches').'" />',  
          '<input type="submit" name="updatecaches" '.  
              'value="'.&mt('Update Caches').'" />');  
     #      #
     return @Buttons;      return @Buttons;
 }  }

Removed from v.1.13  
changed lines
  Added in v.1.18


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