[LON-CAPA-cvs] cvs: loncom /homework lonhomework.pm

matthew lon-capa-cvs@mail.lon-capa.org
Wed, 14 May 2003 17:16:21 -0000


matthew		Wed May 14 13:16:21 2003 EDT

  Modified files:              
    /loncom/homework	lonhomework.pm 
  Log:
  Modifed viewgrades check to try section restricted viewing.
  
  
Index: loncom/homework/lonhomework.pm
diff -u loncom/homework/lonhomework.pm:1.126 loncom/homework/lonhomework.pm:1.127
--- loncom/homework/lonhomework.pm:1.126	Mon May 12 21:56:32 2003
+++ loncom/homework/lonhomework.pm	Wed May 14 13:16:20 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Homework handler
 #
-# $Id: lonhomework.pm,v 1.126 2003/05/13 01:56:32 www Exp $
+# $Id: lonhomework.pm,v 1.127 2003/05/14 17:16:20 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -286,7 +286,14 @@
 
 sub setuppermissions {
   $Apache::lonhomework::browse= &Apache::lonnet::allowed('bre',$ENV{'request.filename'});
-  $Apache::lonhomework::viewgrades=&Apache::lonnet::allowed('vgr',$ENV{'request.course.id'});
+  my $viewgrades = &Apache::lonnet::allowed('vgr',$ENV{'request.course.id'});
+  if (! $viewgrades && 
+      exists($ENV{'request.course.sec'}) && 
+      $ENV{'request.course.sec'} !~ /^\s*$/) {
+      $viewgrades = &Apache::lonnet::allowed('vgr',$ENV{'request.course.id'}.
+                                               '/'.$ENV{'request.course.sec'});
+  }
+  $Apache::lonhomework::viewgrades = $viewgrades;
   return ''
 }