--- loncom/interface/lontrackstudent.pm 2009/08/28 22:47:07 1.30 +++ loncom/interface/lontrackstudent.pm 2017/11/12 23:06:51 1.40 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lontrackstudent.pm,v 1.30 2009/08/28 22:47:07 raeburn Exp $ +# $Id: lontrackstudent.pm,v 1.40 2017/11/12 23:06:51 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -185,12 +185,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 +251,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; } @@ -432,15 +432,26 @@ sub convert_timezone { sub display_values { my ($action,$values)=@_; my $result=''; - if ($action eq 'CSTORE') { + if (($action eq 'CSTORE') || ($action eq 'PUTSTORE')) { + my $is_anon; my %values=map {split('=',$_,-1)} split(/\&/,$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.=''; } $result.='
'. - &unescape($key). + $unesc_key. '='. &unescape($values{$key}).'
'; + if ($is_anon) { + $result = ''.&mt('Anonymous Survey Submission: details not shown').''; + } } elsif ($action eq 'POST') { my %values; foreach my $pair (split(/\&/,$values)) { @@ -525,15 +536,6 @@ sub handler { my $r=shift; 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 if (! &Apache::lonnet::allowed('vsa',$env{'request.course.id'})) { $env{'user.error.msg'}= @@ -571,12 +573,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')); @@ -584,16 +588,8 @@ sub handler { # # Begin form output $r->print('
'); - $r->print('
'); - $r->print('
'. - &mt('Status: [_1]', - ''). - '
'); $r->rflush(); - my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin - ($r,&mt('Student Activity Retrieval'), - &mt('Student Activity Retrieval'),undef,'inline',undef, - 'trackstudent','status'); + my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r); &Apache::lonhtmlcommon::Update_PrgWin ($r,\%prog_state,&mt('Contacting course home server')); # @@ -616,8 +612,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