--- loncom/interface/lontrackstudent.pm 2004/12/13 21:08:09 1.9 +++ 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.9 2004/12/13 21:08:09 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,10 +56,20 @@ sub get_data { &Apache::lonhtmlcommon::Update_PrgWin ($r,$prog_state,&mt('Composing Query')); # - my $query = &build_query($mode); # Allow the other server to begin processing the data before we ask for it. sleep(5); - &Apache::lonnet::logthis('sending query '.$query); + # + 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 ='.
@@ -189,6 +267,7 @@ sub output_results {
##
##
while (my $line = };
if ($src =~ m|^/adm/|) {
$tablerow .=
- ' ';
$r->print($tablerow.$/);
}
@@ -284,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'};
@@ -416,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
'.$key.' '.
+ '= '.$values{$key}.'