version 1.25, 2008/12/20 04:31:55
|
version 1.28, 2009/03/26 17:36:39
|
Line 48 use Apache::lonmysql;
|
Line 48 use Apache::lonmysql;
|
use Apache::lonnet; |
use Apache::lonnet; |
use Apache::lonlocal; |
use Apache::lonlocal; |
use Time::HiRes; |
use Time::HiRes; |
|
use DateTime(); |
use lib '/home/httpd/lib/perl/'; |
use lib '/home/httpd/lib/perl/'; |
use LONCAPA; |
use LONCAPA; |
|
|
Line 122 sub get_data {
|
Line 123 sub get_data {
|
)); |
)); |
$r->print('<br />'); |
$r->print('<br />'); |
} |
} |
|
$r->print('<hr />'); |
$text = 'Resubmit last request to check for newer data'; |
$text = 'Resubmit last request to check for newer data'; |
$r->print(&Apache::loncommon::track_student_link($text,$sname,$sdom,undef, |
$r->print(&Apache::loncommon::track_student_link($text,$sname,$sdom,undef, |
$env{'form.start'})); |
$env{'form.start'})); |
Line 265 sub output_results {
|
Line 267 sub output_results {
|
if ($mode eq 'full_class') { |
if ($mode eq 'full_class') { |
$tableheader = |
$tableheader = |
'<table><tr>'. |
'<table><tr>'. |
|
'<th> </th>'. |
'<th>'.&mt('Resource').'</th>'. |
'<th>'.&mt('Resource').'</th>'. |
'<th>'.&mt('Time').'</th>'. |
'<th>'.&mt('Time').'</th>'. |
'<th>'.&mt('Student').'</th>'. |
'<th>'.&mt('Student').'</th>'. |
Line 275 sub output_results {
|
Line 278 sub output_results {
|
} elsif ($mode =~ /^student:(.*):(.*)$/) { |
} elsif ($mode =~ /^student:(.*):(.*)$/) { |
$tableheader = |
$tableheader = |
'<table><tr>'. |
'<table><tr>'. |
|
'<th> </th>'. |
'<th>'.&mt('Resource').'</th>'. |
'<th>'.&mt('Resource').'</th>'. |
'<th>'.&mt('Time').'</th>'. |
'<th>'.&mt('Time').'</th>'. |
'<th>'.&mt('Action').'</th>'. |
'<th>'.&mt('Action').'</th>'. |
Line 286 sub output_results {
|
Line 290 sub output_results {
|
$r->rflush(); |
$r->rflush(); |
## |
## |
## |
## |
|
|
|
my $cid = $env{'request.course.id'}; |
|
my $cnum = $env{'course.'.$cid.'.num'}; |
|
my $cdom = $env{'course.'.$cid.'.domain'}; |
|
my $server_timezone = &Apache::lonnet::get_server_timezone($cnum,$cdom); |
|
if ($server_timezone ne '') { |
|
if (&Apache::lonlocal::gettimezone($server_timezone) eq 'local') { |
|
$server_timezone = ''; |
|
} |
|
} |
|
|
while (my $line = <ACTIVITYDATA>) { |
while (my $line = <ACTIVITYDATA>) { |
# FIXME: does not pass symbs along :( |
# FIXME: does not pass symbs along :( |
chomp($line); |
chomp($line); |
Line 367 sub output_results {
|
Line 382 sub output_results {
|
'<a href="'.$src.'">'.$title.'</a>'. |
'<a href="'.$src.'">'.$title.'</a>'. |
'</span></td>'; |
'</span></td>'; |
} |
} |
|
if ($server_timezone ne '') { |
|
$timestamp = &convert_timezone($server_timezone,$timestamp); |
|
} |
$tablerow .= '<td valign="top"><span class="LC_nobreak">'.$timestamp.'</span></td>'; |
$tablerow .= '<td valign="top"><span class="LC_nobreak">'.$timestamp.'</span></td>'; |
if ($mode eq 'full_class') { |
if ($mode eq 'full_class') { |
$tablerow.='<td valign="top">'.$student.'</td>'; |
$tablerow.='<td valign="top">'.$student.'</td>'; |
Line 383 sub output_results {
|
Line 401 sub output_results {
|
return $count; |
return $count; |
} |
} |
|
|
|
sub convert_timezone { |
|
my ($server_timezone,$timestamp) = @_; |
|
if ($server_timezone && $timestamp) { |
|
my ($date,$time) = split(/\s+/,$timestamp); |
|
my ($year,$month,$day) = split(/\-/,$date); |
|
my ($hour,$minute,$sec) = split(/:/,$time); |
|
foreach ($month,$day,$hour,$minute,$sec) { |
|
return $timestamp if $_ eq ''; |
|
$_ =~ s/^0//; |
|
} |
|
my $dt = DateTime->new(year => $year, |
|
month => $month, |
|
day => $day, |
|
hour => $hour, |
|
minute => $minute, |
|
second => $sec, |
|
time_zone => $server_timezone, |
|
); |
|
my $unixtime = $dt->epoch; |
|
$timestamp = &Apache::lonlocal::locallocaltime($unixtime); |
|
} |
|
return $timestamp; |
|
} |
|
|
################################################################### |
################################################################### |
################################################################### |
################################################################### |
sub display_values { |
sub display_values { |
Line 538 sub handler {
|
Line 580 sub handler {
|
$r->print('<form name="trackstudent" method="post" action="/adm/trackstudent">'); |
$r->print('<form name="trackstudent" method="post" action="/adm/trackstudent">'); |
$r->print('<br />'); |
$r->print('<br />'); |
$r->print('<div name="statusline">'. |
$r->print('<div name="statusline">'. |
&mt('Status:[_1]', |
&mt('Status: [_1]', |
'<input type="text" name="status" size="60" value="" />'). |
'<input type="text" name="status" size="60" value="" readonly="readonly" />'). |
'</div>'); |
'</div>'); |
$r->rflush(); |
$r->rflush(); |
my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin |
my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin |
Line 560 sub handler {
|
Line 602 sub handler {
|
$r->print('<h2>'. |
$r->print('<h2>'. |
&mt('Recent activity of [_1]:[_2]',$sname,$sdom). |
&mt('Recent activity of [_1]:[_2]',$sname,$sdom). |
'</h2>'); |
'</h2>'); |
$r->print('<p>'.&mt(<<END).'</p>'); |
$r->print('<p class="LC_info">' |
Compiling student activity data can take a long time. |
.&mt('Compiling student activity data can take a long time.' |
Your request continues to be processed while results are displayed. |
.' Your request continues to be processed while results are displayed.') |
END |
.'</p>' |
|
); |
&get_data($r,\%prog_state,$navmap, |
&get_data($r,\%prog_state,$navmap, |
'student:'.$env{'form.selected_student'}); |
'student:'.$env{'form.selected_student'}); |
} else { |
} else { |