--- loncom/interface/statistics/lonstathelpers.pm 2004/06/15 14:26:10 1.14 +++ loncom/interface/statistics/lonstathelpers.pm 2004/08/03 19:53:12 1.18 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstathelpers.pm,v 1.14 2004/06/15 14:26:10 matthew Exp $ +# $Id: lonstathelpers.pm,v 1.18 2004/08/03 19:53:12 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -262,12 +262,14 @@ sub get_prev_curr_next { next if ($res->{'type'} ne 'assessment'); foreach my $part (@{$res->{'parts'}}) { my $partdata = $res->{'partdata'}->{$part}; - if ($granularity eq 'part_survey' && $partdata->{'Survey'}){ - push (@Resource, - { symb => $res->{symb}, - part => $part, - resource => $res, - } ); + if ($partdata->{'Survey'}) { + if ($granularity eq 'part_survey'){ + push (@Resource, + { symb => $res->{symb}, + part => $part, + resource => $res, + } ); + } } elsif ($granularity eq 'part') { push (@Resource, { symb => $res->{symb}, @@ -637,7 +639,7 @@ sub ensure_proper_cache { my ($symb) = @_; my $cid = $ENV{'request.course.id'}; my $new_filename = '/home/httpd/perl/tmp/'. - 'problemanalsysis_'.$cid.'answer_cache.db'; + 'problemanalysis_'.$cid.'_answer_cache.db'; if (! defined($cache_filename) || $cache_filename ne $new_filename || ! defined($current_symb) || @@ -1071,24 +1073,40 @@ Returns: An array of scalars containing sub manage_caches { my ($r,$formname,$inputname) = @_; &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'}) || - exists($ENV{'form.updatecaches'}) || - (exists($ENV{'form.firstrun'}) && - $ENV{'form.firstrun'} ne 'no')) { + exists($ENV{'form.updatecaches'}) || + (exists($ENV{'form.firstrun'}) && $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, $inputname); } # + my @Buttons = + ('', + ''. + &Apache::loncommon::help_open_topic('Statistics_Cache'), + '', + '' + ); + # if (! exists($ENV{'form.firstrun'})) { $r->print(''); } else { $r->print(''); } - my @Buttons = - ('', - ''); # return @Buttons; }