--- loncom/interface/lontrackstudent.pm 2004/08/29 19:58:32 1.6 +++ loncom/interface/lontrackstudent.pm 2005/04/07 06:56:23 1.15 @@ -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.15 2005/04/07 06:56:23 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -44,7 +44,8 @@ package Apache::lontrackstudent; use strict; use Apache::Constants qw(:common :http); -use Apache::lonnet(); +use Apache::lonmysql; +use Apache::lonnet; use Apache::lonlocal; use Time::HiRes; @@ -55,11 +56,23 @@ 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,12 +364,40 @@ 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'};
- my $domain = $ENV{'course.'.$cid.'.domain'};
- my $home = $ENV{'course.'.$cid.'.home'};
- my $course = $ENV{'course.'.$cid.'.num'};
+ my $cid = $env{'request.course.id'};
+ my $domain = $env{'course.'.$cid.'.domain'};
+ my $home = $env{'course.'.$cid.'.home'};
+ my $course = $env{'course.'.$cid.'.num'};
# &Apache::lonnet::logthis($command.' '.$course.' '.$domain.' '.$home);
my $result = &Apache::lonnet::metadata_query($command,$course,$domain,
[$home]);
@@ -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; }
@@ -352,18 +463,18 @@ sub handler {
$loaderror=
&Apache::lonnet::overloaderror
($r,
- $ENV{'course.'.$ENV{'request.course.id'}.'.home'});
+ $env{'course.'.$env{'request.course.id'}.'.home'});
if ($loaderror) { return $loaderror; }
#
# Check for access
- if (! &Apache::lonnet::allowed('vsa',$ENV{'request.course.id'})) {
- $ENV{'user.error.msg'}=
+ if (! &Apache::lonnet::allowed('vsa',$env{'request.course.id'})) {
+ $env{'user.error.msg'}=
$r->uri.":vsa:0:0:Cannot student activity for complete course";
if (!
&Apache::lonnet::allowed('vsa',
- $ENV{'request.course.id'}.'/'.
- $ENV{'request.course.sec'})) {
- $ENV{'user.error.msg'}=
+ $env{'request.course.id'}.'/'.
+ $env{'request.course.sec'})) {
+ $env{'user.error.msg'}=
$r->uri.":vsa:0:0:Cannot view student activity with given role";
return HTTP_NOT_ACCEPTABLE;
}
@@ -390,7 +501,8 @@ sub handler {
bug=>'instructor interface'});
#
# Give the LON-CAPA page header
- $r->print(''.&styles.''.$key.' '.
+ '= '.$values{$key}.' '.
&mt('Recent activity of [_1]@[_2]',$sname,$sdom).
'
');
+ $r->print(''.&mt('Unable to process for [_1]@[_2]',
$sname,$sdom).'
');