--- loncom/interface/lontrackstudent.pm 2006/05/01 19:37:34 1.19
+++ loncom/interface/lontrackstudent.pm 2007/02/12 23:58:42 1.22
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lontrackstudent.pm,v 1.19 2006/05/01 19:37:34 albertel Exp $
+# $Id: lontrackstudent.pm,v 1.22 2007/02/12 23:58:42 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -48,6 +48,8 @@ use Apache::lonmysql;
use Apache::lonnet;
use Apache::lonlocal;
use Time::HiRes;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
my $num_records=500;
@@ -108,12 +110,21 @@ sub get_data {
&Apache::lonhtmlcommon::Update_PrgWin
($r,$prog_state,&mt('Parsing results'));
#
- &output_results($r,$results_file,$navmap,$mode);
+ my $last = &output_results($r,$results_file,$navmap,$mode);
my ($sname,$sdom) = ($mode=~/^student:(.*):(.*)$/);
- $r->print(&Apache::loncommon::track_student_link(
- 'View more activity by this student',
- $sname,$sdom,undef,
- ($env{'form.start'}+$num_records)));
+
+ my ($text,$inc);
+ if ( $last > 0 && (($last+1) >= $env{'form.start'}+$num_records) ) {
+ $text = 'View more activity by this student';
+ $inc = $num_records;
+ $r->print(&Apache::loncommon::track_student_link($text,$sname,$sdom,undef,
+ ($env{'form.start'}+$inc)
+ ));
+ $r->print('
');
+ }
+ $text = 'Resubmit last request to check for newer data';
+ $r->print(&Apache::loncommon::track_student_link($text,$sname,$sdom,undef,
+ $env{'form.start'}));
&Apache::lonhtmlcommon::Update_PrgWin($r,$prog_state,&mt('Finished!'));
return;
@@ -183,7 +194,7 @@ sub get_max_time_in_db {
my $timestr = '';
while (my $line = '.&mt('So far, no data has been returned for your request').'
');
- return;
+ return -1;
}
if (! open(ACTIVITYDATA,$results_file)) {
$r->print(''.&mt('Unable to read results file.').'
'.
@@ -246,7 +257,7 @@ sub output_results {
'You should contact your system administrator '.
'to resolve this issue.').
'
'.&mt(<'.&mt('Unable to process for [_1]@[_2]',
+ $r->print('
'.&mt('Unable to process for [_1]:[_2]',
$sname,$sdom).'
');
}
} else {