[LON-CAPA-cvs] cvs: loncom /interface lonstatistics.pm /interface/statistics loncorrectproblemplot.pm lonproblemanalysis.pm lonproblemstatistics.pm lonstathelpers.pm lonstudentsubmissions.pm lonsubmissiontimeanalysis.pm
matthew
lon-capa-cvs@mail.lon-capa.org
Fri, 04 Jun 2004 21:42:19 -0000
This is a MIME encoded message
--matthew1086385339
Content-Type: text/plain
matthew Fri Jun 4 17:42:19 2004 EDT
Modified files:
/loncom/interface lonstatistics.pm
/loncom/interface/statistics loncorrectproblemplot.pm
lonproblemanalysis.pm
lonproblemstatistics.pm
lonstathelpers.pm
lonstudentsubmissions.pm
lonsubmissiontimeanalysis.pm
Log:
Unified cache handling among statistics routines. All use inlined progress
dialog.
&lonstatistics:&Gather_Full_Student_data now takes $formname and $inputname
for inlined progress dialog.
&lonstathelpers: All calls to lonstatistics::Sequences_with_Assess now pass
parameter 'all' in for mode. Added &manage_caches which takes care of
updating student data at the right times. "right times" may need some
work. &GetStudentAnswers now takes $formname, $inputname as parameters.
&lonproblemanalysis, &lonproblemstatistics, and &lonsubmissiontimeanalysis:
Use lonstathelpers::manage_caches and inline progress dialog.
&lonstudentsubmissions: Uses lonstathelpers::manage_caches and inlines prgwin
Uses inlined prgwin to display further status data.
--matthew1086385339
Content-Type: text/plain
Content-Disposition: attachment; filename="matthew-20040604174219.txt"
Index: loncom/interface/lonstatistics.pm
diff -u loncom/interface/lonstatistics.pm:1.102 loncom/interface/lonstatistics.pm:1.103
--- loncom/interface/lonstatistics.pm:1.102 Fri Jun 4 13:41:35 2004
+++ loncom/interface/lonstatistics.pm Fri Jun 4 17:42:18 2004
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonstatistics.pm,v 1.102 2004/06/04 17:41:35 matthew Exp $
+# $Id: lonstatistics.pm,v 1.103 2004/06/04 21:42:18 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -905,7 +905,13 @@
###############################################
###############################################
sub Gather_Full_Student_Data {
- my ($r) = @_;
+ my ($r,$formname,$inputname) = @_;
+ my $status_type;
+ if (defined($formname)) {
+ $status_type = 'inline';
+ } else {
+ $status_type = 'popup';
+ }
my $c = $r->connection();
#
&Apache::loncoursedata::clear_internal_caches();
@@ -915,7 +921,8 @@
# Open the progress window
my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin
($r,&mt('Student Data Compilation Status'),
- &mt('Student Data Compilation Progress'), scalar(@Students));
+ &mt('Student Data Compilation Progress'), scalar(@Students),
+ $status_type,undef,$formname,$inputname);
#
while (my $student = shift @Students) {
return if ($c->aborted());
Index: loncom/interface/statistics/loncorrectproblemplot.pm
diff -u loncom/interface/statistics/loncorrectproblemplot.pm:1.10 loncom/interface/statistics/loncorrectproblemplot.pm:1.11
--- loncom/interface/statistics/loncorrectproblemplot.pm:1.10 Mon Mar 8 13:42:58 2004
+++ loncom/interface/statistics/loncorrectproblemplot.pm Fri Jun 4 17:42:18 2004
@@ -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 @@
my @SubmitButtons = (
{ name => 'CreatePlot',
text => 'Create Plot' },
- { name => 'ClearCache',
- text => 'Clear Caches' },
- { name => 'updatecaches',
- text => 'Update Student Data' },
);
#########################################################
@@ -81,23 +77,16 @@
'</h2>');
}
#
- &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('<input type="hidden" name="firstanalysis" value="yes" />');
- } else {
- $r->print('<input type="hidden" name="firstanalysis" value="no" />');
- }
+ my @CacheButtonHTML =
+ &Apache::lonstathelpers::manage_caches($r,'Statistics','stats_status');
foreach my $button (@SubmitButtons) {
$r->print('<input type="submit" name="'.$button->{'name'}.'" '.
'value="'.&mt($button->{'text'}).'" />');
$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 @@
$Apache::lonstatistics::enrollment_status,undef,
$starttime,$endtime);
$r->print(&AnalyzeScoreData($score_data,$title,$total_parts));
+ } else {
+ $r->print('<h3>'.&mt('Make a sequence selection from the "Sequences and Folders" menu and hit "Create Plot" to begin').'</h3>');
}
return;
}
@@ -177,7 +168,8 @@
# 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 = '<table border="1">'."\n".'<tr><th>Range</th><th>Count</th></tr>'."\n";
+ my $Str =
+ '<table border="1">'."\n".'<tr><th>Range</th><th>Count</th></tr>'."\n";
my $sum = 0;
while (my $bin = shift(@Bins)) {
push (@Xdata,$bin->{'start'});
@@ -193,7 +185,7 @@
$max = 5*(int($max/5)+1);
$Str .= "</table><br />\n";
$title = &HTML::Entities::decode($title);
- $Str = "<br />\n".&Apache::loncommon::DrawBarGraph($title.' N = '.$sum,
+ $Str = "\n<p>".&Apache::loncommon::DrawBarGraph($title.' N = '.$sum,
'Num Correct Problems (max:'.$total_parts.')',
'Number of students',
$max,
@@ -201,6 +193,7 @@
\@Xdata,
\@Ydata).
"\n<br />\n".$Str;
+ $Str .= '</p>'."\n";
return $Str;
}
@@ -281,6 +274,8 @@
my $Str;
$Str .= &Apache::lonhtmlcommon::breadcrumbs
(undef,'Correct Problems Plot');
+ $Str .= '<p>';
+ #
$Str .= '<table cellspacing="5">'."\n";
$Str .= '<tr>';
$Str .= '<td align="center"><b>'.&mt('Sections').'</b></td>';
@@ -289,8 +284,7 @@
$Str .= '<td rowspan="2">'.
&Apache::lonstathelpers::limit_by_time_form().'</td>';
$Str .= '</tr>'."\n";
- ##
- ##
+ #
$Str .= '<tr><td align="center">'."\n";
$Str .= &Apache::lonstatistics::SectionSelect('Section','multiple',5);
$Str .= '</td>';
@@ -311,9 +305,14 @@
$only_seq_with_assessments);
$Str .= '</td>';
#
- ##
$Str .= '</tr>'."\n";
$Str .= '</table>'."\n";
+ #
+ $Str .= '<nobr>'.&mt('Status: [_1]',
+ '<input type="text" '.
+ 'name="stats_status" size="60" value="" />').
+ '</nobr>'.'</p>';
+ ##
return $Str;
}
Index: loncom/interface/statistics/lonproblemanalysis.pm
diff -u loncom/interface/statistics/lonproblemanalysis.pm:1.84 loncom/interface/statistics/lonproblemanalysis.pm:1.85
--- loncom/interface/statistics/lonproblemanalysis.pm:1.84 Thu Apr 1 10:32:06 2004
+++ loncom/interface/statistics/lonproblemanalysis.pm Fri Jun 4 17:42:18 2004
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonproblemanalysis.pm,v 1.84 2004/04/01 15:32:06 albertel Exp $
+# $Id: lonproblemanalysis.pm,v 1.85 2004/06/04 21:42:18 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -51,10 +51,6 @@
{ 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',
@@ -85,18 +81,8 @@
$r->print('<h2>There are no students in the sections selected</h2>');
}
#
- &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('<input type="hidden" name="firstanalysis" value="yes" />');
- } else {
- $r->print('<input type="hidden" name="firstanalysis" value="no" />');
- }
+ my @CacheButtonHTML =
+ &Apache::lonstathelpers::manage_caches($r,'Statistics','stats_status');
$r->rflush();
#
my $problem_types = '(option|radiobutton|numerical)';
@@ -111,6 +97,9 @@
$r->print(' 'x5);
}
}
+ foreach my $html (@CacheButtonHTML) {
+ $r->print($html.(' 'x5));
+ }
#
$r->print('<hr />');
$r->rflush();
@@ -230,8 +219,10 @@
}
#
# 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
@@ -1468,7 +1459,7 @@
$Str .= '</select></nobr><br />';
}
{
- $Str .= '<br /><nobr>'.&mt('Number of Plots:');
+ $Str .= '<nobr>'.&mt('Number of Plots:');
$Str .= &Apache::loncommon::help_open_topic
('Analysis_num_plots');
$Str .= '<select name="NumPlots">';
@@ -1482,7 +1473,14 @@
if ($ENV{'form.NumPlots'} == $i) { $Str.=' selected '; }
$Str .= '>'.$i.'</option>';
}
- $Str .= '</select></nobr>';
+ $Str .= '</select></nobr><br />';
+ }
+ {
+ $Str .= '<nobr>'.&mt('Status: [_1]',
+ '<input type="text" '.
+ 'name="stats_status" size="60" value="" />'
+ ).
+ '</nobr><br />';
}
}
$Str .= '</td>';
Index: loncom/interface/statistics/lonproblemstatistics.pm
diff -u loncom/interface/statistics/lonproblemstatistics.pm:1.86 loncom/interface/statistics/lonproblemstatistics.pm:1.87
--- loncom/interface/statistics/lonproblemstatistics.pm:1.86 Tue May 18 14:12:19 2004
+++ loncom/interface/statistics/lonproblemstatistics.pm Fri Jun 4 17:42:18 2004
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonproblemstatistics.pm,v 1.86 2004/05/18 18:12:19 matthew Exp $
+# $Id: lonproblemstatistics.pm,v 1.87 2004/06/04 21:42:18 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -547,6 +547,7 @@
###############################################
###############################################
sub CreateInterface {
+ my ($r) = @_;
#
&parse_field_selection();
#
@@ -582,19 +583,18 @@
$Str .= '</td><td>'.&field_selection_input();
$Str .= '</td></tr>'."\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="'.
&mt('Generate Statistics').'" />';
$Str .= ' 'x5;
$Str .= 'Plot '.&plot_dropdown().(' 'x10);
- $Str .= '<input type="submit" name="ClearCache" value="'.
- &mt('Clear Caches').'" />';
- $Str .= ' 'x5;
- $Str .= '<input type="submit" name="UpdateCache" value="'.
- &mt('Update Student Data').'" />';
- $Str .= ' 'x5;
- $Str .= '<input type="submit" name="Excel" value="'.
- &mt('Produce Excel Output').'" />';
- $Str .= ' 'x5;
+ #
return $Str;
}
@@ -632,13 +632,20 @@
undef(%SeqStat);
#
# Finally let the user know we are here
- my $interface = &CreateInterface();
+ my $interface = &CreateInterface($r);
$r->print($interface);
$r->print('<input type="hidden" name="sortby" value="'.$ENV{'form.sortby'}.
'" />');
#
- if (! exists($ENV{'form.statsfirstcall'})) {
- $r->print('<input type="hidden" name="statsfirstcall" value="yes" />');
+ my @CacheButtonHTML =
+ &Apache::lonstathelpers::manage_caches($r,'Statistics','stats_status');
+ my $Str;
+ foreach my $html (@CacheButtonHTML) {
+ $Str.=$html.(' 'x5);
+ }
+ #
+ $r->print($Str);
+ if (! exists($ENV{'form.firstrun'})) {
$r->print('<h3>'.
&mt('Press "Generate Statistics" when you are ready.').
'</h3><p>'.
@@ -647,13 +654,6 @@
' will not have this delay.').
'</p>');
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();
#
@@ -663,7 +663,10 @@
#
if (exists($ENV{'form.Excel'})) {
&Excel_output($r);
- } else {
+ } else {
+ $r->print('<input type="submit" name="Excel" value="'.
+ &mt('Produce Excel Output').'" />'.' 'x5);
+ $r->rflush();
my $count = 0;
foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) {
$count += $seq->{'num_assess_parts'};
Index: loncom/interface/statistics/lonstathelpers.pm
diff -u loncom/interface/statistics/lonstathelpers.pm:1.11 loncom/interface/statistics/lonstathelpers.pm:1.12
--- loncom/interface/statistics/lonstathelpers.pm:1.11 Thu Apr 1 17:13:39 2004
+++ loncom/interface/statistics/lonstathelpers.pm Fri Jun 4 17:42:18 2004
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonstathelpers.pm,v 1.11 2004/04/01 22:13:39 matthew Exp $
+# $Id: lonstathelpers.pm,v 1.12 2004/06/04 21:42:18 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -118,7 +118,7 @@
my ($AcceptedResponseTypes) = @_;
my $Str;
$Str = "\n<table>\n";
- foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) {
+ foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess('all')) {
next if ($seq->{'num_assess'}<1);
my $seq_str = '';
foreach my $res (@{$seq->{'contents'}}) {
@@ -255,7 +255,7 @@
#
# Build an array with the data we need to search through
my @Resource;
- foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) {
+ foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess('all')) {
foreach my $res (@{$seq->{'contents'}}) {
next if ($res->{'type'} ne 'assessment');
foreach my $part (@{$res->{'parts'}}) {
@@ -363,7 +363,13 @@
#####################################################
#####################################################
sub GetStudentAnswers {
- my ($r,$problem,$Students) = @_;
+ my ($r,$problem,$Students,$formname,$inputname) = @_;
+ my $status_type;
+ if (defined($formname)) {
+ $status_type = 'inline';
+ } else {
+ $status_type = 'popup';
+ }
my $c = $r->connection();
my %Answers;
my ($resource,$partid,$respid) = ($problem->{'resource'},
@@ -374,7 +380,8 @@
# Open progress window
my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin
($r,'Student Answer Compilation Status',
- 'Student Answer Compilation Progress', scalar(@$Students));
+ 'Student Answer Compilation Progress', scalar(@$Students),
+ $status_type,undef,$formname,$inputname);
$r->rflush();
foreach my $student (@$Students) {
last if ($c->aborted());
@@ -1043,6 +1050,49 @@
=pod
+=item &manage_caches
+
+Inputs: $r, apache request object
+
+Returns: An array of scalars containing html for buttons.
+
+=cut
+
+####################################################
+####################################################
+sub manage_caches {
+ my ($r,$formname,$inputname) = @_;
+ &Apache::loncoursedata::clear_internal_caches();
+ if (exists($ENV{'form.ClearCache'}) ||
+ exists($ENV{'form.updatecaches'}) ||
+ (exists($ENV{'form.firstrun'}) &&
+ $ENV{'form.firstrun'} ne 'no')) {
+ &Apache::lonstatistics::Gather_Full_Student_Data($r,$formname,
+ $inputname);
+ }
+ #
+ if (! exists($ENV{'form.firstrun'})) {
+ $r->print('<input type="hidden" name="firstrun" value="yes" />');
+ } else {
+ $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;
+}
+
+
+
+
+####################################################
+####################################################
+
+=pod
+
=back
=cut
Index: loncom/interface/statistics/lonstudentsubmissions.pm
diff -u loncom/interface/statistics/lonstudentsubmissions.pm:1.10 loncom/interface/statistics/lonstudentsubmissions.pm:1.11
--- loncom/interface/statistics/lonstudentsubmissions.pm:1.10 Tue Mar 16 11:41:26 2004
+++ loncom/interface/statistics/lonstudentsubmissions.pm Fri Jun 4 17:42:18 2004
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonstudentsubmissions.pm,v 1.10 2004/03/16 16:41:26 matthew Exp $
+# $Id: lonstudentsubmissions.pm,v 1.11 2004/06/04 21:42:18 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -43,10 +43,6 @@
{ name => 'NextProblem',
text => 'Next Problem' },
{ name => 'break'},
- { name => 'ClearCache',
- text => 'Clear Caches' },
- { name => 'updatecaches',
- text => 'Update Student Data' },
{ name => 'SelectAnother',
text => 'Choose a different Problem' },
{ name => 'Generate',
@@ -75,18 +71,8 @@
$r->print('<h2>There are no students in the sections selected</h2>');
}
#
- &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('<input type="hidden" name="firstanalysis" value="yes" />');
- } else {
- $r->print('<input type="hidden" name="firstanalysis" value="no" />');
- }
+ my @CacheButtonHTML =
+ &Apache::lonstathelpers::manage_caches($r,'Statistics','stats_status');
$r->rflush();
#
if (exists($ENV{'form.problemchoice'}) &&
@@ -100,6 +86,9 @@
$r->print(' 'x5);
}
}
+ foreach my $html (@CacheButtonHTML) {
+ $r->print($html.(' 'x5));
+ }
#
$r->print('<hr />');
$r->rflush();
@@ -170,8 +159,14 @@
&mt('Preparing Excel spreadsheet of student responses').
'</h2>');
#
- &Apache::lonstathelpers::GetStudentAnswers($r,$problem,$Students);
+ &Apache::lonstathelpers::GetStudentAnswers($r,$problem,$Students,
+ 'Statistics','stats_status');
#
+ $r->print('<script>'.
+ 'window.document.Statistics.stats_status.value="'.
+ 'Done computing student answers. Compiling spreadsheet.'.
+ '";</script>');
+ $r->rflush();
my @Columns = ( 'username','domain','attempt','time',
'submission','correct', 'grading','awarded','weight',
'score');
@@ -285,6 +280,12 @@
$r->print('<p><a href="'.$filename.'">'.
&mt('Your Excel spreadsheet.').
'</a></p>'."\n");
+ $r->print('<script>'.
+ 'window.document.Statistics.stats_status.value="'.
+ 'Done compiling spreadsheet. See link below to download.'.
+ '";</script>');
+ $r->rflush();
+
}
#########################################################
@@ -300,14 +301,13 @@
my $Str = '';
$Str .= &Apache::lonhtmlcommon::breadcrumbs
(undef,'Student Submission Reports');
+ $Str .= '<p>';
$Str .= '<table cellspacing="5">'."\n";
$Str .= '<tr>';
$Str .= '<td align="center"><b>'.&mt('Sections').'</b></td>';
$Str .= '<td align="center"><b>'.&mt('Enrollment Status').'</b></td>';
- $Str .= '<td align="center"> </td>';
$Str .= '</tr>'."\n";
- ##
- ##
+ #
$Str .= '<tr><td align="center">'."\n";
$Str .= &Apache::lonstatistics::SectionSelect('Section','multiple',5);
$Str .= '</td>';
@@ -316,26 +316,14 @@
$Str .= &Apache::lonhtmlcommon::StatusOptions(undef,undef,5);
$Str .= '</td>';
#
- $Str .= '<td></td>';
- #
- my $only_seq_with_assessments = sub {
- my $s=shift;
- if ($s->{'num_assess'} < 1) {
- return 0;
- } else {
- return 1;
- }
- };
- ##
- ##
$Str .= '</tr>'."\n";
$Str .= '</table>'."\n";
#
- # We do this to make sure the sequence information is initialized
- &Apache::lonstatistics::MapSelect('Maps','multiple,all',5,
- $only_seq_with_assessments);
-
- #
+ $Str .= '<nobr>'.&mt('Status: [_1]',
+ '<input type="text" '.
+ 'name="stats_status" size="60" value="" />').
+ '</nobr>'.'</p>';
+ ##
return $Str;
}
Index: loncom/interface/statistics/lonsubmissiontimeanalysis.pm
diff -u loncom/interface/statistics/lonsubmissiontimeanalysis.pm:1.14 loncom/interface/statistics/lonsubmissiontimeanalysis.pm:1.15
--- loncom/interface/statistics/lonsubmissiontimeanalysis.pm:1.14 Mon Mar 1 11:39:19 2004
+++ loncom/interface/statistics/lonsubmissiontimeanalysis.pm Fri Jun 4 17:42:19 2004
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonsubmissiontimeanalysis.pm,v 1.14 2004/03/01 16:39:19 matthew Exp $
+# $Id: lonsubmissiontimeanalysis.pm,v 1.15 2004/06/04 21:42:19 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -75,18 +75,8 @@
$r->print('<h2>There are no students in the sections selected</h2>');
}
#
- &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('<input type="hidden" name="firstanalysis" value="yes" />');
- } else {
- $r->print('<input type="hidden" name="firstanalysis" value="no" />');
- }
+ my @CacheButtonHTML =
+ &Apache::lonstathelpers::manage_caches($r,'Statistics','stats_status');
$r->rflush();
#
if (! exists($ENV{'form.problemchoice'}) ||
@@ -102,6 +92,10 @@
'value="'.&mt($button->{'text'}).'" />');
$r->print(' 'x5);
}
+ foreach my $html (@CacheButtonHTML) {
+ $r->print($html.(' 'x5));
+ }
+ $r->rflush();
#
# Determine which problem we are to analyze
my $current_problem = &Apache::lonstathelpers::get_target_from_id
@@ -136,6 +130,7 @@
$r->print('<h3>'.$resource->{'src'}.'</h3>');
$r->rflush();
$r->print(&Apache::lonstathelpers::render_resource($resource));
+ $r->print('<br />');
$r->rflush();
$r->print(&analyze_times($r,$resource,\@Students,
$current_problem->{'part'}));
@@ -334,11 +329,11 @@
## Build the menu
my $Str = '';
$Str .= &Apache::lonhtmlcommon::breadcrumbs(undef,'Submission Time Plots');
+ $Str .= '<p>';
$Str .= '<table cellspacing="5">'."\n";
$Str .= '<tr>';
$Str .= '<td align="center"><b>'.&mt('Sections').'</b></td>';
$Str .= '<td align="center"><b>'.&mt('Enrollment Status').'</b></td>';
- $Str .= '<td align="center"> </td>';
$Str .= '</tr>'."\n";
##
##
@@ -349,21 +344,14 @@
$Str .= '<td align="center">';
$Str .= &Apache::lonhtmlcommon::StatusOptions(undef,undef,5);
$Str .= '</td>';
- #
- my $only_seq_with_assessments = sub {
- my $s=shift;
- if ($s->{'num_assess'} < 1) {
- return 0;
- } else {
- return 1;
- }
- };
- &Apache::lonstatistics::MapSelect('Maps','multiple,all',5,
- $only_seq_with_assessments);
- ##
- ##
$Str .= '</tr>'."\n";
$Str .= '</table>'."\n";
+ #
+ $Str .= '<nobr>'.&mt('Status: [_1]',
+ '<input type="text" '.
+ 'name="stats_status" size="60" value="" />').
+ '</nobr>'.'</p>';
+ ##
return $Str;
}
--matthew1086385339--