version 1.27, 2009/03/26 16:30:58
|
version 1.34, 2012/10/04 13:41:10
|
Line 119 sub get_data {
|
Line 119 sub get_data {
|
$text = 'View more activity by this student'; |
$text = 'View more activity by this student'; |
$inc = $num_records; |
$inc = $num_records; |
$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'}+$inc) |
($env{'form.start'}+$inc), |
|
$env{'form.only_body'} |
)); |
)); |
$r->print('<br />'); |
$r->print('<br />'); |
} |
} |
$r->print('<hr />'); |
$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'}, |
|
$env{'form.only_body'})); |
|
|
&Apache::lonhtmlcommon::Update_PrgWin($r,$prog_state,&mt('Finished!')); |
&Apache::lonhtmlcommon::Update_PrgWin($r,$prog_state,&mt('Finished!')); |
return; |
return; |
Line 249 sub output_results {
|
Line 251 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('<p class="LC_info">'.&mt('So far, no data has been returned for your request').'</p>'); |
return -1; |
return -1; |
} |
} |
if (! open(ACTIVITYDATA,$results_file)) { |
if (! open(ACTIVITYDATA,$results_file)) { |
$r->print('<h2>'.&mt('Unable to read results file.').'</h2>'. |
$r->print('<p class="LC_error">'.&mt('Unable to read results file.').'</p>'. |
'<p>'. |
'<p>'. |
&mt('This is a serious error and has been logged. '. |
&mt('This is a serious error and has been logged. '. |
'You should contact your system administrator '. |
'You should contact your system administrator '. |
Line 431 sub display_values {
|
Line 433 sub display_values {
|
my ($action,$values)=@_; |
my ($action,$values)=@_; |
my $result='<table>'; |
my $result='<table>'; |
if ($action eq 'CSTORE') { |
if ($action eq 'CSTORE') { |
|
my $is_anon; |
my %values=map {split('=',$_,-1)} split(/\&/,$values); |
my %values=map {split('=',$_,-1)} split(/\&/,$values); |
foreach my $key (sort(keys(%values))) { |
foreach my $key (sort(keys(%values))) { |
|
my $unesc_key = &unescape($key); |
|
if ($values{$key} eq 'anonsurvey' || $values{$key} eq 'anonsurveycred') { |
|
if ($unesc_key =~ /^resource\..+\.type$/) { |
|
$is_anon = 1; |
|
last; |
|
} |
|
} |
$result.='<tr><td align="right">'. |
$result.='<tr><td align="right">'. |
&unescape($key). |
$unesc_key. |
'</td><td>=</td><td align="left">'. |
'</td><td>=</td><td align="left">'. |
&unescape($values{$key}).'</td></tr>'; |
&unescape($values{$key}).'</td></tr>'; |
} |
} |
$result.='</table>'; |
$result.='</table>'; |
|
if ($is_anon) { |
|
$result = '<span class="LC_warning">'.&mt('Anonymous Survey Submission: details not shown').'</span>'; |
|
} |
} elsif ($action eq 'POST') { |
} elsif ($action eq 'POST') { |
my %values; |
my %values; |
foreach my $pair (split(/\&/,$values)) { |
foreach my $pair (split(/\&/,$values)) { |
Line 523 sub handler {
|
Line 536 sub handler {
|
my $r=shift; |
my $r=shift; |
my $c = $r->connection(); |
my $c = $r->connection(); |
# |
# |
# Check for overloading here and on the course home server |
|
my $loaderror=&Apache::lonnet::overloaderror($r); |
|
if ($loaderror) { return $loaderror; } |
|
$loaderror= |
|
&Apache::lonnet::overloaderror |
|
($r, |
|
$env{'course.'.$env{'request.course.id'}.'.home'}); |
|
if ($loaderror) { return $loaderror; } |
|
# |
|
# Check for access |
# Check for access |
if (! &Apache::lonnet::allowed('vsa',$env{'request.course.id'})) { |
if (! &Apache::lonnet::allowed('vsa',$env{'request.course.id'})) { |
$env{'user.error.msg'}= |
$env{'user.error.msg'}= |
Line 554 sub handler {
|
Line 558 sub handler {
|
# |
# |
# Extract form elements from query string |
# Extract form elements from query string |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
['selected_student','start']); |
['selected_student','start','only_body']); |
# |
# |
# We will almost always need this... |
# We will almost always need this... |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
Line 572 sub handler {
|
Line 576 sub handler {
|
bug=>'instructor interface'}); |
bug=>'instructor interface'}); |
# |
# |
# Give the LON-CAPA page header |
# Give the LON-CAPA page header |
$r->print(&Apache::loncommon::start_page('Student Activity',&styles()). |
my $args; |
|
if ($env{'form.only_body'}) { |
|
$args = { only_body => 1, }; |
|
} |
|
$r->print(&Apache::loncommon::start_page('Student Activity',&styles(),$args). |
&Apache::lonhtmlcommon::breadcrumbs('Student Activity')); |
&Apache::lonhtmlcommon::breadcrumbs('Student Activity')); |
$r->rflush(); |
$r->rflush(); |
# |
# |
Line 580 sub handler {
|
Line 588 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($r); |
($r,&mt('Student Activity Retrieval'), |
|
&mt('Student Activity Retrieval'),undef,'inline',undef, |
|
'trackstudent','status'); |
|
&Apache::lonhtmlcommon::Update_PrgWin |
&Apache::lonhtmlcommon::Update_PrgWin |
($r,\%prog_state,&mt('Contacting course home server')); |
($r,\%prog_state,&mt('Contacting course home server')); |
# |
# |
Line 600 sub handler {
|
Line 605 sub handler {
|
if ($sname =~ /^$LONCAPA::username_re$/ |
if ($sname =~ /^$LONCAPA::username_re$/ |
&& $sdom =~ /^$LONCAPA::domain_re$/) { |
&& $sdom =~ /^$LONCAPA::domain_re$/) { |
$r->print('<h2>'. |
$r->print('<h2>'. |
&mt('Recent activity of [_1]:[_2]',$sname,$sdom). |
&mt('Recent activity of [_1]',$sname.':'.$sdom). |
'</h2>'); |
'</h2>'); |
$r->print('<p class="LC_info">' |
$r->print('<p class="LC_info">' |
.&mt('Compiling student activity data can take a long time.' |
.&mt('Compiling student activity data can take a long time.' |
Line 610 sub handler {
|
Line 615 sub handler {
|
&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( |
$sname,$sdom).'</h2>'); |
'<p class="LC_error">' |
|
.&mt('Unable to process for [_1]:[_2]',$sname,$sdom) |
|
.'</p>' |
|
); |
} |
} |
} else { |
} else { |
# For now, just show all the data instead of limiting it to one student |
# For now, just show all the data instead of limiting it to one student |