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

matthew lon-capa-cvs@mail.lon-capa.org
Thu, 17 Jul 2003 15:22:14 -0000


matthew		Thu Jul 17 11:22:14 2003 EDT

  Modified files:              
    /loncom/interface/spreadsheet	lonspreadsheet.pm 
  Log:
  Implement standard grading for spreadsheet by not allowing anyone with a
  student role to view the spreadsheet if standard grading is in effect.
  
  
Index: loncom/interface/spreadsheet/lonspreadsheet.pm
diff -u loncom/interface/spreadsheet/lonspreadsheet.pm:1.16 loncom/interface/spreadsheet/lonspreadsheet.pm:1.17
--- loncom/interface/spreadsheet/lonspreadsheet.pm:1.16	Wed Jul 16 09:52:19 2003
+++ loncom/interface/spreadsheet/lonspreadsheet.pm	Thu Jul 17 11:22:14 2003
@@ -1,5 +1,5 @@
 #
-# $Id: lonspreadsheet.pm,v 1.16 2003/07/16 13:52:19 matthew Exp $
+# $Id: lonspreadsheet.pm,v 1.17 2003/07/17 15:22:14 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -213,6 +213,14 @@
         $ENV{'user.error.msg'}=
             $r->uri.":opa:0:0:Cannot modify spreadsheet";
         return HTTP_NOT_ACCEPTABLE; 
+    }
+    my $courseid = $ENV{'request.course.id'};
+    #
+    # Do not allow students to continue if standard grading is in effect.
+    if ($ENV{'request.role'} =~ /^st\./) {
+        if ($ENV{'course.'.$courseid.'.grading'} eq 'standard') {
+            return HTTP_NOT_ACCEPTABLE;
+        }
     }
     #
     # Get query string for limited number of parameters