[LON-CAPA-cvs] cvs: loncom /interface lonmenu.pm

www lon-capa-cvs@mail.lon-capa.org
Mon, 23 Jun 2003 19:08:03 -0000


www		Mon Jun 23 15:08:03 2003 EDT

  Modified files:              
    /loncom/interface	lonmenu.pm 
  Log:
  Bug #1796, #1578: PGRD, PPRM, SUBM now shows for section instructors.
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.78 loncom/interface/lonmenu.pm:1.79
--- loncom/interface/lonmenu.pm:1.78	Wed Jun 18 23:03:32 2003
+++ loncom/interface/lonmenu.pm	Mon Jun 23 15:08:03 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.78 2003/06/19 03:03:32 www Exp $
+# $Id: lonmenu.pm,v 1.79 2003/06/23 19:08:03 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -245,17 +245,23 @@
         my $hwkadd='';
         if 
       ($ENV{'request.filename'}=~/\.(problem|exam|quiz|assess|survey|form)$/) {
-	    if (&Apache::lonnet::allowed('vgr',$ENV{'request.course.id'})) {
+	    my $crs='/'.$ENV{'request.course.id'};
+	    if ($ENV{'request.course.sec'}) {
+	        $crs.='_'.$ENV{'request.course.sec'};
+	    }
+	    $crs=~s/\_/\//g;
+
+	    if (&Apache::lonnet::allowed('vgr',$crs)) {
 		$hwkadd.=&switch('','',7,1,'subm.gif','view sub-','missions',
                        "gocmd('/adm/grades','submission')",
 		       'View user submissions for this assessment resource');
             }
-	    if (&Apache::lonnet::allowed('mgr',$ENV{'request.course.id'})) {
+	    if (&Apache::lonnet::allowed('mgr',$crs)) {
 		$hwkadd.=&switch('','',7,2,'pgrd.gif','problem','grades',
                        "gocmd('/adm/grades','gradingmenu')",
                        'Modify user grades for this assessment resource');
             }
-	    if (&Apache::lonnet::allowed('opa',$ENV{'request.course.id'})) {
+	    if (&Apache::lonnet::allowed('opa',$crs)) {
 		$hwkadd.=&switch('','',7,3,'pparm.gif','problem','parms',
                        "gocmd('/adm/parmset','set')",
                        'Modify deadlines, etc, for this assessment resource');