--- loncom/interface/statistics/loncorrectproblemplot.pm 2004/03/08 18:42:58 1.10 +++ loncom/interface/statistics/loncorrectproblemplot.pm 2004/06/04 21:42:18 1.11 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: loncorrectproblemplot.pm,v 1.10 2004/03/08 18:42:58 matthew Exp $ +# $Id: loncorrectproblemplot.pm,v 1.11 2004/06/04 21:42:18 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -39,10 +39,6 @@ use Apache::lonlocal; my @SubmitButtons = ( { name => 'CreatePlot', text => 'Create Plot' }, - { name => 'ClearCache', - text => 'Clear Caches' }, - { name => 'updatecaches', - text => 'Update Student Data' }, ); ######################################################### @@ -81,23 +77,16 @@ sub BuildCorrectProblemsPage { ''); } # - &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'); foreach my $button (@SubmitButtons) { $r->print(''); $r->print(' 'x5); } + foreach my $html (@CacheButtonHTML) { + $r->print($html.(' 'x5)); + } $r->rflush(); # # Determine which problem symbs we are to sum over @@ -135,6 +124,8 @@ sub BuildCorrectProblemsPage { $Apache::lonstatistics::enrollment_status,undef, $starttime,$endtime); $r->print(&AnalyzeScoreData($score_data,$title,$total_parts)); + } else { + $r->print('

'.&mt('Make a sequence selection from the "Sequences and Folders" menu and hit "Create Plot" to begin').'

'); } return; } @@ -177,7 +168,8 @@ sub AnalyzeScoreData { # Get the data into the bins (destroying $score_data in the process) my @Bins = &bin_data($score_data,$binsize,$lowest,$highest); my @Xdata; my @Ydata; my $max; - my $Str = ''."\n".''."\n"; + my $Str = + '
RangeCount
'."\n".''."\n"; my $sum = 0; while (my $bin = shift(@Bins)) { push (@Xdata,$bin->{'start'}); @@ -193,7 +185,7 @@ sub AnalyzeScoreData { $max = 5*(int($max/5)+1); $Str .= "
RangeCount

\n"; $title = &HTML::Entities::decode($title); - $Str = "
\n".&Apache::loncommon::DrawBarGraph($title.' N = '.$sum, + $Str = "\n

".&Apache::loncommon::DrawBarGraph($title.' N = '.$sum, 'Num Correct Problems (max:'.$total_parts.')', 'Number of students', $max, @@ -201,6 +193,7 @@ sub AnalyzeScoreData { \@Xdata, \@Ydata). "\n
\n".$Str; + $Str .= '

'."\n"; return $Str; } @@ -281,6 +274,8 @@ sub CreateInterface { my $Str; $Str .= &Apache::lonhtmlcommon::breadcrumbs (undef,'Correct Problems Plot'); + $Str .= '

'; + # $Str .= ''."\n"; $Str .= ''; $Str .= ''; @@ -289,8 +284,7 @@ sub CreateInterface { $Str .= ''; $Str .= ''."\n"; - ## - ## + # $Str .= ''; @@ -311,9 +305,14 @@ sub CreateInterface { $only_seq_with_assessments); $Str .= ''; # - ## $Str .= ''."\n"; $Str .= '
'.&mt('Sections').''. &Apache::lonstathelpers::limit_by_time_form().'
'."\n"; $Str .= &Apache::lonstatistics::SectionSelect('Section','multiple',5); $Str .= '
'."\n"; + # + $Str .= ''.&mt('Status: [_1]', + ''). + ''.'

'; + ## return $Str; }