'."\n";
- $Str .= '
'. + &mt('There are no currently enrolled students in the course.'). + ' '; + } elsif (lc($env{'form.Status'}) eq 'expired') { + $Str .= ''. + &mt('There are no previously enrolled students in the course.'). + ' '; + } elsif (lc($env{'form.Status'}) eq 'future') { + $Str .= ''. + &mt('There are no students with future access in the course.'). + ' '; + } else { # 'any' and any others + $Str .= ''. + &mt('There are no students in the course.'). + ' '; + } + } else { + if (lc($env{'form.Status'}) eq 'active') { + $Str .= ''. + &mt('There are no currently enrolled students in the selected sections.'). + ' '; + } elsif (lc($env{'form.Status'}) eq 'expired') { + $Str .= ''. + &mt('There are no previously enrolled students in the selected sections.'). + ' '; + } elsif (lc($env{'form.Status'}) eq 'future') { + $Str .= ''. + &mt('There are no students with future access in the selected sections.'). + ' '; + } else { # 'any' and any others + $Str .= ''. + &mt('There are no students in the selected sections.'). + ' '; + } } - $alternate = ($alternate + 1) % 2; - foreach my $data (@$studentInformation) { + $Str.= '' + .'' + .&mt('Return to the chart').'' + .' '; + $r->print($Str); + $r->rflush(); + return; + } + + $Str .= ''.&mt('Select One Student').'' + .''.&mt("Click on a student's name or username to view their chart").' ' + .&Apache::loncommon::start_data_table() + .&Apache::loncommon::start_data_table_header_row(); + foreach my $field (@Fields) { + $Str .= ''.&mt($field).
+ ' | ';
+ }
+ $Str .= &Apache::loncommon::end_data_table_header_row();
+ #
+ foreach my $student (@Students) { # @Students is a package variable
+ my $sname = $student->{'username'}.':'.$student->{'domain'};
+ $Str .= &Apache::loncommon::start_data_table_row();
+ #
+ foreach my $field (@Fields) {
$Str .= '';
- if($data eq 'fullname') {
+ if ($field eq 'fullname' || $field eq 'username') {
$Str .= '';
- $Str .= $cache{$_.':'.$data}.' ';
+ $Str .= &escape('student_assessment');
+ $Str .= '&sort='.&escape($env{'form.sort'});
+ $Str .= '&SelectedStudent=';
+ $Str .= &escape($sname).'">';
+ $Str .= $student->{$field}.' ';
$Str .= '';
- } elsif($data eq 'updateTime') {
- $Str .= '';
- $Str .= $cache{$_.':'.$data}.' ';
- $Str .= ' ';
+ } elsif ($field eq 'status') {
+ $Str .= &mt($student->{$field});
} else {
- $Str .= $cache{$_.':'.$data}.' ';
+ $Str .= $student->{$field};
}
-
- $Str .= ' | '."\n";
+ $Str .= '';
}
+ $Str .= &Apache::loncommon::end_data_table_row();
}
+ $Str .= &Apache::loncommon::end_data_table();
+ #
+ $r->print($Str);
+ $r->rflush();
+ #
+ return;
+}
- $Str .= ' |
'."\n"; - $Str .= ' | Analysis Reports: | '."\n"; - $Str .= 'Student Status: | |
{'reportSelected'} eq $reports->{$_}) { - $Str .= ' selected=""'; - } - $Str .= '>'.$reports->{$_}.''."\n"; - } - $Str .= ' | '."\n"; - - $Str .= ''; - $Str .= &Apache::lonhtmlcommon::StatusOptions($status, 'Statistics'); - $Str .= ' | '."\n"; +sub handler { + my $r=shift; + my $c = $r->connection(); + # + # Check for overloading + 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('vgr',$env{'request.course.id'})) { + $env{'user.error.msg'}= + $r->uri.":vgr:0:0:Cannot view grades for complete course"; + if (! &Apache::lonnet::allowed('vgr', + $env{'request.course.id'}.'/'.$env{'request.course.sec'})) { + $env{'user.error.msg'}= + $r->uri.":vgr:0:0:Cannot view grades with given role"; + return HTTP_NOT_ACCEPTABLE; + } + } + # + # Send the header + &Apache::loncommon::no_cache($r); + &Apache::loncommon::content_type($r,'text/html'); + $r->send_http_header; + if ($r->header_only) { return OK; } + # + # Extract form elements from query string + &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, + ['sort','reportSelected', + 'SelectedStudent']); + # + # Give the LON-CAPA page header + my $style = <