--- loncom/interface/statistics/lonproblemanalysis.pm 2004/03/22 17:25:27 1.82
+++ loncom/interface/statistics/lonproblemanalysis.pm 2004/06/24 18:47:36 1.87
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonproblemanalysis.pm,v 1.82 2004/03/22 17:25:27 matthew Exp $
+# $Id: lonproblemanalysis.pm,v 1.87 2004/06/24 18:47:36 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -51,10 +51,6 @@ my @SubmitButtons = ({ name => 'PrevProb
{ name => 'NextProblemAnalysis',
text => 'Next Problem' },
{ name => 'break'},
- { name => 'ClearCache',
- text => 'Clear Caches' },
- { name => 'updatecaches',
- text => 'Update Student Data' },
{ name => 'SelectAnother',
text => 'Choose a different Problem' },
{ name => 'ExcelOutput',
@@ -81,25 +77,18 @@ sub BuildProblemAnalysisPage {
#
my @Students = @Apache::lonstatistics::Students;
#
- if (@Students < 1) {
+ if (@Students < 1 && exists($ENV{'form.firstrun'})) {
$r->print('
There are no students in the sections selected
');
}
#
- &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');
$r->rflush();
#
- my $problem_types = '(option|radiobutton|numerical)';
+ # Support for numerical and radio response isn't complete enough to
+ # include in 1.2 release.
+ # my $problem_types = '(option|radiobutton|numerical)';
+ my $problem_types = '(option)';
if (exists($ENV{'form.problemchoice'}) &&
! exists($ENV{'form.SelectAnother'})) {
foreach my $button (@SubmitButtons) {
@@ -111,6 +100,9 @@ sub BuildProblemAnalysisPage {
$r->print(' 'x5);
}
}
+ foreach my $html (@CacheButtonHTML) {
+ $r->print($html.(' 'x5));
+ }
#
$r->print('
');
$r->rflush();
@@ -230,8 +222,10 @@ sub NumericalResponseAnalysis {
}
#
# This next call causes all the waiting around that people complain about
- my ($max,$min) = &Apache::lonstathelpers::GetStudentAnswers($r,$problem,
- $Students);
+ my ($max,$min) =
+ &Apache::lonstathelpers::GetStudentAnswers($r,$problem,$Students,
+ 'Statistics',
+ 'stats_status');
return if ($c->aborted());
#
# Collate the data
@@ -1320,18 +1314,18 @@ sub build_foil_index {
if (@Concepts > 1) {
$table .= ''.
''.$conceptindex.' | '.
- ''.&HTML::Entities::encode($concept->{'name'}).' | '.
+ ''.&HTML::Entities::encode($concept->{'name'},'<>&"').' | '.
''.$foilindex++.' | '.
- ''.&HTML::Entities::encode($Foildata{$firstfoil}->{'name'}).' | '.
+ ''.&HTML::Entities::encode($Foildata{$firstfoil}->{'name'},'<>&"').' | '.
''.$Foildata{$firstfoil}->{'text'}.' | '.
- ''.&HTML::Entities::encode($Foildata{$firstfoil}->{'value'}).' | '.
+ ''.&HTML::Entities::encode($Foildata{$firstfoil}->{'value'},'<>&"').' | '.
"
\n";
} else {
$table .= ''.
''.$foilindex++.' | '.
- ''.&HTML::Entities::encode($Foildata{$firstfoil}->{'name'}).' | '.
+ ''.&HTML::Entities::encode($Foildata{$firstfoil}->{'name'},'<>&"').' | '.
''.$Foildata{$firstfoil}->{'text'}.' | '.
- ''.&HTML::Entities::encode($Foildata{$firstfoil}->{'value'}).' | '.
+ ''.&HTML::Entities::encode($Foildata{$firstfoil}->{'value'},'<>&"').' | '.
"
\n";
}
foreach my $foilid (@FoilsInConcept) {
@@ -1340,16 +1334,16 @@ sub build_foil_index {
' | '.
' | '.
''.$foilindex.' | '.
- ''.&HTML::Entities::encode($Foildata{$foilid}->{'name'}).' | '.
+ ''.&HTML::Entities::encode($Foildata{$foilid}->{'name'},'<>&"').' | '.
''.$Foildata{$foilid}->{'text'}.' | '.
- ''.&HTML::Entities::encode($Foildata{$foilid}->{'value'}).' | '.
+ ''.&HTML::Entities::encode($Foildata{$foilid}->{'value'},'<>&"').' | '.
"\n";
} else {
$table .= ''.
''.$foilindex.' | '.
- ''.&HTML::Entities::encode($Foildata{$foilid}->{'name'}).' | '.
+ ''.&HTML::Entities::encode($Foildata{$foilid}->{'name'},'<>&"').' | '.
''.$Foildata{$foilid}->{'text'}.' | '.
- ''.&HTML::Entities::encode($Foildata{$foilid}->{'value'}).' | '.
+ ''.&HTML::Entities::encode($Foildata{$foilid}->{'value'},'<>&"').' | '.
"
\n";
}
} continue {
@@ -1374,7 +1368,7 @@ sub build_option_index {
''.
''.
(' 'x4).' | '.
- ''.&HTML::Entities::encode($option).' | '.
+ ''.&HTML::Entities::encode($option,'<>&"').' | '.
"
\n");
}
shift(@Rows); # Throw away 'correct option chosen' color
@@ -1468,7 +1462,7 @@ sub CreateInterface {
$Str .= '
';
}
{
- $Str .= '
'.&mt('Number of Plots:');
+ $Str .= ''.&mt('Number of Plots:');
$Str .= &Apache::loncommon::help_open_topic
('Analysis_num_plots');
$Str .= '';
+ $Str .= '
';
+ }
+ {
+ $Str .= ''.&mt('Status: [_1]',
+ ''
+ ).
+ '
';
}
}
$Str .= '';