]> git.mjollnir.org Git - moodle.git/commitdiff
fixed bug 990 which allowed students to see grades even when they were not supposed...
authorgustav_delius <gustav_delius>
Sat, 8 May 2004 15:56:37 +0000 (15:56 +0000)
committergustav_delius <gustav_delius>
Sat, 8 May 2004 15:56:37 +0000 (15:56 +0000)
course/grade.php

index b1bf0ed5f198a100b73b9270a6f77ada5b5d5fe7..9a66ab269cdb8e557ddeb4b801bd95eec26b2571 100644 (file)
@@ -1,16 +1,20 @@
 <?PHP // $Id$
       // Displays all grades for a student in a course
 
-       require_once("../config.php");
-       require_once("lib.php");
+    require_once("../config.php");
+    require_once("lib.php");
 
     require_variable($id);              // course id
 
     if (! $course = get_record("course", "id", $id)) {
         error("Course ID was incorrect");
     }
+    
+    if (!$course->showgrades) {
+        error("Grades are not available for students in this course");
+    }
 
-       require_login($course->id);
+    require_login($course->id);
 
     $strgrades = get_string("grades");
     $strgrade = get_string("grade");