version 1.10, 2004/12/16 22:04:41
|
version 1.11, 2004/12/22 22:54:59
|
Line 281 sub output_results {
|
Line 281 sub output_results {
|
} |
} |
my ($symb,$timestamp,$student,$action,$machine,$values); |
my ($symb,$timestamp,$student,$action,$machine,$values); |
if ($mode eq 'full_class') { |
if ($mode eq 'full_class') { |
($symb,$timestamp,$student,$action,$machine,$values) = |
($symb,$timestamp,$student,$action,$machine,$values) = split(',',$line,6); |
map { &Apache::lonnet::unescape($_); } split(',',$line,6); |
|
} else { |
} else { |
($symb,$timestamp,$action,$machine,$values) = |
($symb,$timestamp,$action,$machine,$values) = split(',',$line,5); |
map { &Apache::lonnet::unescape($_); } split(',',$line,5); |
|
} |
} |
|
foreach ($symb,$timestamp,$student,$action,$machine) { |
|
$_=&Apache::lonnet::unescape($_); |
|
} |
my ($title,$src); |
my ($title,$src); |
if ($symb =~ m:^/adm/:) { |
if ($symb =~ m:^/adm/:) { |
$title = $symb; |
$title = $symb; |
Line 294 sub output_results {
|
Line 295 sub output_results {
|
} else { |
} else { |
my $nav_res = $navmap->getBySymb($symb); |
my $nav_res = $navmap->getBySymb($symb); |
if (defined($nav_res)) { |
if (defined($nav_res)) { |
$title = $nav_res->title(); |
$title = $nav_res->compTitle(); |
$src = $nav_res->src(); |
$src = $nav_res->src(); |
} else { |
} else { |
if ($src =~ m|^/res|) { |
if ($src =~ m|^/res|) { |
Line 334 sub output_results {
|
Line 335 sub output_results {
|
$class = 'warning'; |
$class = 'warning'; |
} |
} |
# Clean up the values |
# Clean up the values |
$values =~ s/counter=\d+$//; |
$values = &display_values($action,$values); |
# |
# |
# Build the row for output |
# Build the row for output |
my $tablerow = qq{<tr class="$class">}; |
my $tablerow = qq{<tr class="$class">}; |
if ($src =~ m|^/adm/|) { |
if ($src =~ m|^/adm/|) { |
$tablerow .= |
$tablerow .= |
'<td><nobr>'.$title.'</td>'; |
'<td valign="top"><nobr>'.$title.'</nobr></td>'; |
} else { |
} else { |
$tablerow .= |
$tablerow .= |
'<td><nobr>'. |
'<td valign="top"><nobr>'. |
'<a href="'.$src.'">'.$title.'</a>'. |
'<a href="'.$src.'">'.$title.'</a>'. |
'</nobr></td>'; |
'</nobr></td>'; |
} |
} |
$tablerow .= '<td><nobr>'.$timestamp.'</nobr></td>'; |
$tablerow .= '<td valign="top"><nobr>'.$timestamp.'</nobr></td>'; |
if ($mode eq 'full_class') { |
if ($mode eq 'full_class') { |
$tablerow.='<td>'.$student.'</td>'; |
$tablerow.='<td valign="top">'.$student.'</td>'; |
} |
} |
$tablerow .= |
$tablerow .= |
'<td>'.$action.'</td>'. |
'<td valign="top">'.$action.'</td>'. |
# '<td>'.$machine.'</td>'. |
# '<td>'.$machine.'</td>'. |
'<td>'.$values.'</td>'. |
'<td valign="top">'.$values.'</td>'. |
'</tr>'; |
'</tr>'; |
$r->print($tablerow.$/); |
$r->print($tablerow.$/); |
} |
} |
Line 365 sub output_results {
|
Line 366 sub output_results {
|
|
|
################################################################### |
################################################################### |
################################################################### |
################################################################### |
|
sub display_values { |
|
my ($action,$values)=@_; |
|
my $result='<table>'; |
|
if ($action eq 'CSTORE') { |
|
my %values=map {split('=',$_,-1)} split(/\&/,$values); |
|
foreach my $key (sort(keys(%values))) { |
|
$result.='<tr><td align="right">'. |
|
&Apache::lonnet::unescape($key). |
|
'</td><td>=</td><td align="left">'. |
|
&Apache::lonnet::unescape($values{$key}).'</td></tr>'; |
|
} |
|
$result.='</table>'; |
|
} 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.='<tr><td align="right">'.$key.'</td>'. |
|
'<td>=</td><td align="left">'.$values{$key}.'</td></tr>'; |
|
} |
|
$result.='</table>'; |
|
} else { |
|
$result=&Apache::lonnet::unescape($values) |
|
} |
|
return $result; |
|
} |
|
################################################################### |
|
################################################################### |
sub request_data_update { |
sub request_data_update { |
my $command = 'prepare activity log'; |
my $command = 'prepare activity log'; |
my $cid = $ENV{'request.course.id'}; |
my $cid = $ENV{'request.course.id'}; |