--- loncom/homework/grades.pm 2003/06/20 21:28:18 1.104 +++ loncom/homework/grades.pm 2003/06/20 21:45:20 1.105 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.104 2003/06/20 21:28:18 albertel Exp $ +# $Id: grades.pm,v 1.105 2003/06/20 21:45:20 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -136,7 +136,7 @@ sub getclasslist { } } $section = ($section ne '' ? $section : 'no'); - if (&canview($section)) { + if (1 || &canview($section)) { if ($getsec eq 'all' || $getsec eq $section) { $sections{$section}++; $fullnames{$_}=$fullname; @@ -1847,7 +1847,7 @@ sub viewgrades { #beginning of class grading form $result.= '
'."\n". - ''."\n". + ''."\n". ''."\n". ''."\n". @@ -2080,10 +2080,15 @@ sub editgrades { my ($uname,$udom)=split(/_/,$user); my %newrecord; my $updateflag = 0; - $line .= ''.$uname.' '. $udom.' '. $$fullname{$usercolon}.' '; + my $usec=%$classlist->{"$uname:$udom"}[5]; + if (!&canmodify($usec)) { + my $numcols=scalar(@partid)*(scalar(@parts)-1)*2; + $noupdate.=$line."Not allowed to modify student"; + next; + } foreach (@partid) { my $old_aw = $ENV{'form.GD_'.$user.'_'.$_.'_awarded_s'}; my $old_part_pcr = $old_aw/($weight{$_} ne '0' ? $weight{$_}:1); @@ -2141,7 +2146,8 @@ sub editgrades { } } if ($noupdate) { - $result .= 'No Changes Occured For the Students Below'.$noupdate; + my $numcols=(scalar(@partid)*(scalar(@parts)-1)*2)+3; + $result .= 'No Changes Occured For the Students Below'.$noupdate; } $result .= ''."\n". &show_grading_menu_form ($symb,$url); @@ -3515,7 +3521,7 @@ sub handler { $request->print(&viewgrades($request)); } elsif ($command eq 'handgrade' && $perm{'mgr'}) { $request->print(&processHandGrade($request)); - } elsif ($command eq 'editgrades') { + } elsif ($command eq 'editgrades' && $perm{'mgr'} ) { $request->print(&editgrades($request)); } elsif ($command eq 'verify') { $request->print(&verifyreceipt($request));