version 1.11, 2004/12/22 22:54:59
|
version 1.13, 2005/02/09 21:21:08
|
Line 44 package Apache::lontrackstudent;
|
Line 44 package Apache::lontrackstudent;
|
|
|
use strict; |
use strict; |
use Apache::Constants qw(:common :http); |
use Apache::Constants qw(:common :http); |
|
use Apache::lonmysql; |
use Apache::lonnet(); |
use Apache::lonnet(); |
use Apache::lonlocal; |
use Apache::lonlocal; |
use Time::HiRes; |
use Time::HiRes; |
use Time::Local; |
|
|
|
sub get_data { |
sub get_data { |
my ($r,$prog_state,$navmap,$mode) = @_; |
my ($r,$prog_state,$navmap,$mode) = @_; |
Line 119 sub table_names {
|
Line 119 sub table_names {
|
my $prefix = $course.'_'.$domain.'_'; |
my $prefix = $course.'_'.$domain.'_'; |
# |
# |
my %tables = |
my %tables = |
( student => $prefix.'students', |
( student =>&Apache::lonmysql::fix_table_name($prefix.'students'), |
res => $prefix.'resource', |
res =>&Apache::lonmysql::fix_table_name($prefix.'resource'), |
machine => $prefix.'machine_table', |
machine =>&Apache::lonmysql::fix_table_name($prefix.'machine_table'), |
activity=> $prefix.'activity', |
activity=>&Apache::lonmysql::fix_table_name($prefix.'activity'), |
); |
); |
return %tables; |
return %tables; |
} |
} |
Line 178 sub get_max_time_in_db {
|
Line 178 sub get_max_time_in_db {
|
$timestr = &Apache::lonnet::unescape($line); |
$timestr = &Apache::lonnet::unescape($line); |
} |
} |
close(TIMEDATA); |
close(TIMEDATA); |
my ($year,$month,$day,$hour,$min,$sec) = |
return &Apache::lonmysql::unsqltime($timestr); |
($timestr =~ /^(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)/); |
|
$month -= 1; # Good old timelocal |
|
my $max_time = undef; |
|
if (eval("&timelocal($sec,$min,$hour,$day,$month,$year)")) { |
|
$max_time = &timelocal($sec,$min,$hour,$day,$month,$year); |
|
} |
|
return $max_time; |
|
} |
} |
|
|
sub build_query { |
sub build_query { |
Line 232 sub output_results {
|
Line 225 sub output_results {
|
my ($r,$results_file,$navmap,$mode) = @_; |
my ($r,$results_file,$navmap,$mode) = @_; |
## |
## |
## |
## |
|
if (! -s $results_file) { |
|
# results file is empty, just let them know there is no data |
|
$r->print('<h2>'.&mt('No data was returned for your request').'</h2>'); |
|
return; |
|
} |
if (! open(ACTIVITYDATA,$results_file)) { |
if (! open(ACTIVITYDATA,$results_file)) { |
$r->print('<h2>'.&mt('Unable to read results file.').'</h2>'. |
$r->print('<h2>'.&mt('Unable to read results file.').'</h2>'. |
'<p>'. |
'<p>'. |
Line 526 sub handler {
|
Line 524 sub handler {
|
($r,\%prog_state,&mt('Contacting course home server')); |
($r,\%prog_state,&mt('Contacting course home server')); |
# |
# |
my $result = &request_data_update(); |
my $result = &request_data_update(); |
if (ref($result) eq 'HASH') { |
|
$result = join(' ',map { $_.'=>'.$result->{$_}; } keys(%$result)); |
|
} |
|
# |
# |
if (exists($ENV{'form.selected_student'})) { |
if (exists($ENV{'form.selected_student'})) { |
# For now, just show all the data, in the future allow selection of |
# For now, just show all the data, in the future allow selection of |