]> git.mjollnir.org Git - moodle.git/commitdiff
Non-editing teacher not allowed to change the phase of a Exercise nor
authorrkingdon <rkingdon>
Sun, 17 Oct 2004 16:00:54 +0000 (16:00 +0000)
committerrkingdon <rkingdon>
Sun, 17 Oct 2004 16:00:54 +0000 (16:00 +0000)
delete the teacher's submission(s).

mod/exercise/locallib.php
mod/exercise/view.php

index e4b8357b0f55beedd53b0ff58c397475f2d87221..15c2bb342fc6f24989d153a7f947131d0fa10aee 100644 (file)
@@ -772,8 +772,10 @@ function exercise_list_submissions_for_admin($exercise) {
             foreach ($submissions as $submission) {
                 $action = "<a href=\"submissions.php?action=adminamendtitle&amp;id=$cm->id&amp;sid=$submission->id\">".
                     get_string("amendtitle", "exercise")."</a>";
-                $action .= " | <a href=\"submissions.php?action=adminconfirmdelete&amp;id=$cm->id&amp;sid=$submission->id\">".
-                    get_string("delete", "exercise")."</a>";
+                if (isteacheredit($course->id)) {
+                    $action .= " | <a href=\"submissions.php?action=adminconfirmdelete&amp;id=$cm->id&amp;sid=$submission->id\">".
+                        get_string("delete", "exercise")."</a>";
+                }
                 $table->data[] = array(exercise_print_submission_title($exercise, $submission), 
                         userdate($submission->timecreated), $action);
             }
index ccbb7bd54b1fd6dfc5b093f7fa1d00f7df2036c0..733eea876f0ff18a8acf92178c885fca99cb5c9d 100644 (file)
         $tabs->names = array("1. ".get_string("phase1", "exercise"), 
             "2. ".get_string("phase2", "exercise", $course->student), 
             "3. ".get_string("phase3", "exercise", $course->student)); 
-        $tabs->urls = array("view.php?id=$cm->id&amp;action=setupassignment", 
-            "view.php?id=$cm->id&amp;action=openexercise",
-            "view.php?id=$cm->id&amp;action=makeleaguetableavailable");
+        if (isteacheredit($course->id)) {
+            $tabs->urls = array("view.php?id=$cm->id&amp;action=setupassignment", 
+                "view.php?id=$cm->id&amp;action=openexercise",
+                "view.php?id=$cm->id&amp;action=makeleaguetableavailable");
+        } else {
+            // don't allow non-editing teacher to change phase
+            $tabs->urls = array("view.php?id=$cm->id", 
+                "view.php?id=$cm->id",
+                "view.php?id=$cm->id");
+        }
         if ($exercise->phase) { // phase 1 or more
             $tabs->highlight = $exercise->phase - 1;
             } else {