version 1.20, 2006/05/30 12:46:09
|
version 1.24, 2008/12/11 14:55:15
|
Line 110 sub get_data {
|
Line 110 sub get_data {
|
&Apache::lonhtmlcommon::Update_PrgWin |
&Apache::lonhtmlcommon::Update_PrgWin |
($r,$prog_state,&mt('Parsing results')); |
($r,$prog_state,&mt('Parsing results')); |
# |
# |
&output_results($r,$results_file,$navmap,$mode); |
my $last = &output_results($r,$results_file,$navmap,$mode); |
my ($sname,$sdom) = ($mode=~/^student:(.*):(.*)$/); |
my ($sname,$sdom) = ($mode=~/^student:(.*):(.*)$/); |
$r->print(&Apache::loncommon::track_student_link( |
|
'View more activity by this student', |
my ($text,$inc); |
$sname,$sdom,undef, |
if ( $last > 0 && (($last+1) >= $env{'form.start'}+$num_records) ) { |
($env{'form.start'}+$num_records))); |
$text = 'View more activity by this student'; |
|
$inc = $num_records; |
|
$r->print(&Apache::loncommon::track_student_link($text,$sname,$sdom,undef, |
|
($env{'form.start'}+$inc) |
|
)); |
|
$r->print('<br />'); |
|
} |
|
$text = 'Resubmit last request to check for newer data'; |
|
$r->print(&Apache::loncommon::track_student_link($text,$sname,$sdom,undef, |
|
$env{'form.start'})); |
|
|
&Apache::lonhtmlcommon::Update_PrgWin($r,$prog_state,&mt('Finished!')); |
&Apache::lonhtmlcommon::Update_PrgWin($r,$prog_state,&mt('Finished!')); |
return; |
return; |
Line 239 sub output_results {
|
Line 248 sub output_results {
|
if (! -s $results_file) { |
if (! -s $results_file) { |
# results file is empty, just let them know there is no data |
# results file is empty, just let them know there is no data |
$r->print('<h2>'.&mt('So far, no data has been returned for your request').'</h2>'); |
$r->print('<h2>'.&mt('So far, no data has been returned for your request').'</h2>'); |
return; |
return -1; |
} |
} |
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>'. |
Line 248 sub output_results {
|
Line 257 sub output_results {
|
'You should contact your system administrator '. |
'You should contact your system administrator '. |
'to resolve this issue.'). |
'to resolve this issue.'). |
'</p>'); |
'</p>'); |
return; |
return -2; |
} |
} |
## |
## |
## |
## |
Line 307 sub output_results {
|
Line 316 sub output_results {
|
$title = $nav_res->compTitle(); |
$title = $nav_res->compTitle(); |
$src = $nav_res->src(); |
$src = $nav_res->src(); |
} else { |
} else { |
if ($src =~ m|^/res|) { |
$src = $symb; |
$title = $src; |
if ($src !~ m{/adm}) { |
} elsif ($values =~ /^\s*$/ && |
$title = &Apache::lonnet::gettitle($src); |
(! defined($src) || $src =~ /^\s*$/)) { |
} elsif ($values =~ /^\s*$/ && |
|
(! defined($src) || $src =~ /^\s*$/)) { |
next; |
next; |
} elsif ($values =~ /^\s*$/) { |
} elsif ($values =~ /^\s*$/) { |
$values = $src; |
$values = $src; |
Line 350 sub output_results {
|
Line 360 sub output_results {
|
my $tablerow = qq{<tr class="$class"><td>}.($count+1).qq{</td>}; |
my $tablerow = qq{<tr class="$class"><td>}.($count+1).qq{</td>}; |
if ($src =~ m|^/adm/|) { |
if ($src =~ m|^/adm/|) { |
$tablerow .= |
$tablerow .= |
'<td valign="top"><nobr>'.$title.'</nobr></td>'; |
'<td valign="top"><span class="LC_nobreak">'.$title.'</span></td>'; |
} else { |
} else { |
$tablerow .= |
$tablerow .= |
'<td valign="top"><nobr>'. |
'<td valign="top"><span class="LC_nobreak">'. |
'<a href="'.$src.'">'.$title.'</a>'. |
'<a href="'.$src.'">'.$title.'</a>'. |
'</nobr></td>'; |
'</span></td>'; |
} |
} |
$tablerow .= '<td valign="top"><nobr>'.$timestamp.'</nobr></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 370 sub output_results {
|
Line 380 sub output_results {
|
} |
} |
$r->print('</table>'.$/);### if (! $count % 50); |
$r->print('</table>'.$/);### if (! $count % 50); |
close(ACTIVITYDATA); |
close(ACTIVITYDATA); |
return; |
return $count; |
} |
} |
|
|
################################################################### |
################################################################### |
Line 388 sub display_values {
|
Line 398 sub display_values {
|
} |
} |
$result.='</table>'; |
$result.='</table>'; |
} elsif ($action eq 'POST') { |
} elsif ($action eq 'POST') { |
my %values= |
my %values; |
map {split('=',&unescape($_),-1)} split(/\&/,$values); |
foreach my $pair (split(/\&/,$values)) { |
|
my ($key,$value) = split('=',&unescape($pair),-1); |
|
$values{$key} = $value; |
|
} |
foreach my $key (sort(keys(%values))) { |
foreach my $key (sort(keys(%values))) { |
if ($key eq 'counter') { next; } |
if ($key eq 'counter') { next; } |
$result.='<tr><td align="right">'.$key.'</td>'. |
$result.='<tr><td align="right">'.$key.'</td>'. |
Line 537 sub handler {
|
Line 550 sub handler {
|
# 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 |
# a student |
# a student |
my ($sname,$sdom) = split(':',$env{'form.selected_student'}); |
my ($sname,$sdom) = split(':',$env{'form.selected_student'}); |
if ($sname =~ /^\w*$/ && $sdom =~ /^\w*$/) { |
if ($sname =~ /^$LONCAPA::username_re$/ |
|
&& $sdom =~ /^$LONCAPA::domain_re$/) { |
$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>'.&mt(<<END).'</p>'); |
Compiling student activity data can take a long time. |
Compiling student activity data can take a long time. |
Line 548 END
|
Line 562 END
|
&get_data($r,\%prog_state,$navmap, |
&get_data($r,\%prog_state,$navmap, |
'student:'.$env{'form.selected_student'}); |
'student:'.$env{'form.selected_student'}); |
} else { |
} else { |
$r->print('<h2>'.&mt('Unable to process for [_1]@[_2]', |
$r->print('<h2>'.&mt('Unable to process for [_1]:[_2]', |
$sname,$sdom).'</h2>'); |
$sname,$sdom).'</h2>'); |
} |
} |
} else { |
} else { |