version 1.66, 2003/04/18 15:50:55
|
version 1.70, 2003/05/13 14:30:26
|
Line 230 sub PrepareClasslist {
|
Line 230 sub PrepareClasslist {
|
} |
} |
} |
} |
# |
# |
|
# Deal with instructors with restricted section access |
|
if ($ENV{'request.course.sec'} !~ /^\s*$/) { |
|
@SelectedSections = ($ENV{'request.course.sec'}); |
|
} |
|
# |
# Set up %StudentData |
# Set up %StudentData |
@StudentDataOrder = qw/fullname username domain id section status/; |
@StudentDataOrder = qw/fullname username domain id section status/; |
foreach my $field (@StudentDataOrder) { |
foreach my $field (@StudentDataOrder) { |
Line 238 sub PrepareClasslist {
|
Line 243 sub PrepareClasslist {
|
$StudentData{$field}->{'width'} = |
$StudentData{$field}->{'width'} = |
$StudentData{$field}->{'base_width'}; |
$StudentData{$field}->{'base_width'}; |
} |
} |
|
# |
|
# get the status requested |
|
my $requested_status = 'Active'; |
|
$requested_status = $ENV{'form.Status'} if (exists($ENV{'form.Status'})); |
# |
# |
# Process the classlist |
# Process the classlist |
while (my ($student,$student_data) = each (%$classlist)) { |
while (my ($student,$student_data) = each (%$classlist)) { |
Line 266 sub PrepareClasslist {
|
Line 274 sub PrepareClasslist {
|
# |
# |
# Only put in the list those students we are interested in |
# Only put in the list those students we are interested in |
foreach my $sect (@SelectedSections) { |
foreach my $sect (@SelectedSections) { |
if (($sect eq 'all') || ($section eq $sect)) { |
if ( (($sect eq 'all') || |
|
($section eq $sect)) && |
|
(($studenthash->{'status'} eq $requested_status) || |
|
($requested_status eq 'Any')) |
|
){ |
push (@Students,$studenthash); |
push (@Students,$studenthash); |
last; |
last; |
} |
} |
Line 274 sub PrepareClasslist {
|
Line 286 sub PrepareClasslist {
|
} |
} |
# |
# |
# Put the consolidated section data in the right place |
# Put the consolidated section data in the right place |
@Sections = sort {$a cmp $b} keys(%Sections); |
if ($ENV{'request.course.sec'} !~ /^\s*$/) { |
unshift(@Sections,'all'); # Put 'all' at the front of the list |
@Sections = ($ENV{'request.course.sec'}); |
|
} else { |
|
@Sections = sort {$a cmp $b} keys(%Sections); |
|
unshift(@Sections,'all'); # Put 'all' at the front of the list |
|
} |
# |
# |
# Sort the Students |
# Sort the Students |
my $sortby = 'fullname'; |
my $sortby = 'fullname'; |
Line 832 sub CreateMainMenu {
|
Line 848 sub CreateMainMenu {
|
# |
# |
$Str .= '<table border="0"><tbody><tr>'."\n"; |
$Str .= '<table border="0"><tbody><tr>'."\n"; |
$Str .= '<td></td>'."\n"; |
$Str .= '<td></td>'."\n"; |
|
$Str .= '<td></td>'."\n"; |
$Str .= '<td align="center"><b>Select a Report</b></td>'."\n"; |
$Str .= '<td align="center"><b>Select a Report</b></td>'."\n"; |
$Str .= '<td align="center"><b>Student Status</b></td></tr>'."\n"; |
|
$Str .= '<tr>'."\n"; |
$Str .= '<tr>'."\n"; |
# |
# |
$Str .= '<td align="center"><input type="submit" name="Refresh" '; |
$Str .= '<td align="center">'. |
$Str .= 'value="Update Display" /></td>'."\n"; |
'<input type="submit" name="Refresh" value="Update Display" />'. |
|
"</td>\n"; |
|
$Str .= '<td align="center">'. |
|
'<input type="submit" name="ClearCache" value="Clear Caches" />'. |
|
"</td>\n"; |
# |
# |
$Str .= '<td align="center">'; |
$Str .= '<td align="center">'; |
$Str .= '<select name="reportSelected" >'."\n"; |
$Str .= '<select name="reportSelected" >'."\n"; |
Line 850 sub CreateMainMenu {
|
Line 870 sub CreateMainMenu {
|
} |
} |
$Str .= '</select></td>'."\n"; |
$Str .= '</select></td>'."\n"; |
# |
# |
$Str .= '<td align="center">'; |
|
$Str .= &Apache::lonhtmlcommon::StatusOptions($status, 'Statistics'); |
|
$Str .= '</td>'."\n"; |
|
# |
|
$Str .= '</tr></tbody></table>'."\n"; |
$Str .= '</tr></tbody></table>'."\n"; |
$Str .= '<hr>'."\n"; |
$Str .= '<hr>'."\n"; |
# |
# |
Line 875 sub handler {
|
Line 891 sub handler {
|
if ($loaderror) { return $loaderror; } |
if ($loaderror) { return $loaderror; } |
# |
# |
# Check for access |
# Check for access |
unless(&Apache::lonnet::allowed('vgr',$ENV{'request.course.id'})) { |
if (! &Apache::lonnet::allowed('vgr',$ENV{'request.course.id'})) { |
$ENV{'user.error.msg'}= |
$ENV{'user.error.msg'}= |
$r->uri.":vgr:0:0:Cannot view grades for complete course"; |
$r->uri.":vgr:0:0:Cannot view grades for complete course"; |
return HTTP_NOT_ACCEPTABLE; |
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; |
|
} |
} |
} |
# |
# |
# Set document type for header only |
# Set document type for header only |
Line 925 END
|
Line 946 END
|
return; |
return; |
} |
} |
# |
# |
|
# Clean out the caches |
|
if (exists($ENV{'form.ClearCache'})) { |
|
&Apache::loncoursedata::delete_caches($ENV{'requres.course.id'}); |
|
} |
|
# |
# Set up the statistics and chart environment |
# Set up the statistics and chart environment |
&PrepareClasslist($r); |
&PrepareClasslist($r); |
&PrepareCourseData($r); |
&PrepareCourseData($r); |