--- loncom/interface/lontrackstudent.pm 2004/08/29 19:58:32 1.6 +++ loncom/interface/lontrackstudent.pm 2005/02/09 21:21:08 1.13 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lontrackstudent.pm,v 1.6 2004/08/29 19:58:32 matthew Exp $ +# $Id: lontrackstudent.pm,v 1.13 2005/02/09 21:21:08 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -44,6 +44,7 @@ package Apache::lontrackstudent; use strict; use Apache::Constants qw(:common :http); +use Apache::lonmysql; use Apache::lonnet(); use Apache::lonlocal; use Time::HiRes; @@ -55,8 +56,20 @@ sub get_data { &Apache::lonhtmlcommon::Update_PrgWin ($r,$prog_state,&mt('Composing Query')); # + # Allow the other server to begin processing the data before we ask for it. + sleep(5); + # + my $max_time = &get_max_time_in_db($r,$prog_state); + if (defined($max_time)) { + $r->print('
'. + &mt('This is a serious error and has been logged. '. + 'You should contact your system administrator '. + 'to resolve this issue.'). + '
'); + return; + } + # + my $timestr = ''; + while (my $line ='.
@@ -187,6 +267,7 @@ sub output_results {
##
##
while (my $line = '.&mt(<};
if ($src =~ m|^/adm/|) {
$tablerow .=
- ' ';
$r->print($tablerow.$/);
}
@@ -282,6 +364,34 @@ sub output_results {
###################################################################
###################################################################
+sub display_values {
+ my ($action,$values)=@_;
+ my $result=' ';
+ ' ';
} else {
$tablerow .=
- ' ';
}
- $tablerow .= ' ';
+ $tablerow .= ' ';
if ($mode eq 'full_class') {
- $tablerow.=''.$student.' ';
+ $tablerow.=''.$student.' ';
}
$tablerow .=
- ''.$action.' '.
+ ''.$action.' '.
# ''.$machine.' '.
- ''.$values.' '.
+ ''.$values.' '.
'';
+ if ($action eq 'CSTORE') {
+ my %values=map {split('=',$_,-1)} split(/\&/,$values);
+ foreach my $key (sort(keys(%values))) {
+ $result.='
';
+ } elsif ($action eq 'POST') {
+ my %values=
+ map {split('=',&Apache::lonnet::unescape($_),-1)} split(/\&/,$values);
+ foreach my $key (sort(keys(%values))) {
+ if ($key eq 'counter') { next; }
+ $result.=' ';
+ }
+ $result.=''.
+ &Apache::lonnet::unescape($key).
+ ' = '.
+ &Apache::lonnet::unescape($values{$key}).' ';
+ }
+ $result.='';
+ } else {
+ $result=&Apache::lonnet::unescape($values)
+ }
+ return $result;
+}
+###################################################################
+###################################################################
sub request_data_update {
my $command = 'prepare activity log';
my $cid = $ENV{'request.course.id'};
@@ -328,6 +438,7 @@ sub developer_centric_styles {
tr.warning { background-color: red; }
tr.chat { background-color: yellow; }
tr.chatfetch { background-color: yellow; }
+ tr.evaluate { background-color: red; }
tr.navmaps { background-color: \#777777; }
tr.roles { background-color: \#999999; }
tr.flip { background-color: \#BBBBBB; }
@@ -413,9 +524,6 @@ sub handler {
($r,\%prog_state,&mt('Contacting course home server'));
#
my $result = &request_data_update();
- if (ref($result) eq 'HASH') {
- $result = join(' ',map { $_.'=>'.$result->{$_}; } keys(%$result));
- }
#
if (exists($ENV{'form.selected_student'})) {
# For now, just show all the data, in the future allow selection of
@@ -425,6 +533,10 @@ sub handler {
$r->print(''.$key.' '.
+ '= '.$values{$key}.' '.
&mt('Recent activity of [_1]@[_2]',$sname,$sdom).
'
');
+ $r->print('