--- loncom/homework/grades.pm 2003/06/20 20:13:18 1.103 +++ loncom/homework/grades.pm 2003/07/11 12:54:07 1.110 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.103 2003/06/20 20:13:18 albertel Exp $ +# $Id: grades.pm,v 1.110 2003/07/11 12:54:07 ng Exp $ # # Copyright Michigan State University Board of Trustees # @@ -131,7 +131,6 @@ sub getclasslist { # filter students according to status selected if ($filterlist && $ENV{'form.status'} ne 'Any') { if ($ENV{'form.status'} ne $status) { -Apache->request->print("
removed
"); delete ($classlist->{$_}); next; } @@ -368,28 +367,47 @@ sub listStudents { $request->print(<'.
- '
'. - 'No submissions found for this resource for any students. ('.$num_students.' checked for submissions '; + 'No submissions found for this resource for any students. ('.$num_students. + ' checked for submissions '; } } elsif ($ctr == 1) { $gradeTable =~ s/type=checkbox/type=checkbox checked/; @@ -1059,11 +1109,18 @@ sub submission { (my $url=$ENV{'form.url'})=~s-^http://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--; my ($uname,$udom) = ($ENV{'form.student'},$ENV{'form.userdom'}); - + my $usec = &Apache::lonnet::getsection($udom,$uname,$ENV{'request.course.id'}); $ENV{'form.fullname'} = &get_fullname ($uname,$udom) if $ENV{'form.fullname'} eq ''; my $symb=($ENV{'form.symb'} ne '' ? $ENV{'form.symb'} : (&Apache::lonnet::symbread($url))); if ($symb eq '') { $request->print("Unable to handle ambiguous references:$url:."); return ''; } + + if (!&canview($usec)) { + $request->print('Unable to view requested student.('.$uname.$udom.$usec.$ENV{'request.course.id'}.')'); + $request->print(&show_grading_menu_form($symb,$url)); + return; + } + my $last = ($ENV{'form.lastSub'} eq 'last' ? 'last' : ''); # header info @@ -1258,7 +1315,7 @@ KEYWORDS } else { for my $part (sort keys(%$handgrade)) { foreach (@$string) { - my ($partid,$respid) = /^resource\.(\d+)\.(\d+)\.submission/; + my ($partid,$respid) = /^resource\.(\w+)\.(\w+)\.submission/; if ($part eq ($partid.'_'.$respid)) { my ($ressub,$subval) = split(/:/,$_,2); # Similarity check @@ -1297,7 +1354,7 @@ KEYWORDS } # return if view submission with no grading option - if ($ENV{'form.showgrading'} eq '') { + if ($ENV{'form.showgrading'} eq '' || (!&canmodify($usec))) { $request->print(' |