--- loncom/interface/lontrackstudent.pm 2011/12/21 21:25:40 1.33 +++ loncom/interface/lontrackstudent.pm 2024/11/21 07:26:03 1.41 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lontrackstudent.pm,v 1.33 2011/12/21 21:25:40 www Exp $ +# $Id: lontrackstudent.pm,v 1.41 2024/11/21 07:26:03 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -46,6 +46,7 @@ use strict; use Apache::Constants qw(:common :http); use Apache::lonmysql; use Apache::lonnet; +use Apache::loncommon; use Apache::lonlocal; use Time::HiRes; use DateTime(); @@ -185,12 +186,12 @@ sub get_max_time_in_db { &Apache::lonhtmlcommon::Update_PrgWin ($r,$prog_state,&mt('Parsing results')); # - if (! open(TIMEDATA,$results_file)) { - $r->print('

'.&mt('Unable to read results file.').'

'. + if (! open(TIMEDATA,"<",$results_file)) { + $r->print('

'.&mt('Unable to read results file.').'

'. '

'. - &mt('This is a serious error and has been logged. '. - 'You should contact your system administrator '. - 'to resolve this issue.'). + &mt('This is a serious error and has been logged.'). + '
'. + &mt('Please alert your LON-CAPA administrator.'). '

'); return; } @@ -251,15 +252,15 @@ sub output_results { ## if (! -s $results_file) { # results file is empty, just let them know there is no data - $r->print('

'.&mt('So far, no data has been returned for your request').'

'); + $r->print('

'.&mt('So far, no data has been returned for your request').'

'); return -1; } - if (! open(ACTIVITYDATA,$results_file)) { - $r->print('

'.&mt('Unable to read results file.').'

'. + if (! open(ACTIVITYDATA,"<",$results_file)) { + $r->print('

'.&mt('Unable to read results file.').'

'. '

'. - &mt('This is a serious error and has been logged. '. - 'You should contact your system administrator '. - 'to resolve this issue.'). + &mt('This is a serious error and has been logged.'). + '
'. + &mt('Please alert your LON-CAPA administrator.'). '

'); return -2; } @@ -324,6 +325,9 @@ sub output_results { $_=&unescape($_); } my ($title,$src); + if ($symb =~ m{^\Q/tiny/$cdom/\E\w+$}) { + $symb = &Apache::loncommon::symb_from_tinyurl($symb,$cnum,$cdom); + } if ($symb =~ m:^/adm/:) { $title = $symb; $src = $symb; @@ -346,6 +350,9 @@ sub output_results { $src = '/dev/null'; } } + if ($src =~ /.sequence$/) { + $src .= '?navmap=1'; + } } my %classes; my $class_count=0; @@ -432,7 +439,7 @@ sub convert_timezone { sub display_values { my ($action,$values)=@_; my $result=''; - if ($action eq 'CSTORE') { + if (($action eq 'CSTORE') || ($action eq 'PUTSTORE') || ($action eq 'EXPORT')) { my $is_anon; my %values=map {split('=',$_,-1)} split(/\&/,$values); foreach my $key (sort(keys(%values))) { @@ -573,12 +580,14 @@ sub handler { title=>'Student Activity', text =>'Student Activity', faq=>139, - bug=>'instructor interface'}); + bug=>'instructor interface', + help=>'View_recent_activity'}); # # Give the LON-CAPA page header my $args; if ($env{'form.only_body'}) { $args = { only_body => 1, }; + $args->{'add_progressbar'} = 1; } $r->print(&Apache::loncommon::start_page('Student Activity',&styles(),$args). &Apache::lonhtmlcommon::breadcrumbs('Student Activity')); @@ -586,11 +595,6 @@ sub handler { # # Begin form output $r->print(''); - $r->print('
'); - $r->print('
'. - &mt('Status: [_1]', - ''). - '
'); $r->rflush(); my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r); &Apache::lonhtmlcommon::Update_PrgWin @@ -615,8 +619,11 @@ sub handler { &get_data($r,\%prog_state,$navmap, 'student:'.$env{'form.selected_student'}); } else { - $r->print('

'.&mt('Unable to process for [_1]:[_2]', - $sname,$sdom).'

'); + $r->print( + '

' + .&mt('Unable to process for [_1]:[_2]',$sname,$sdom) + .'

' + ); } } else { # For now, just show all the data instead of limiting it to one student