From b14f1130a302a9f67a2218c579fd1fe7975bf0c9 Mon Sep 17 00:00:00 2001 From: rkingdon Date: Sun, 17 Oct 2004 16:00:54 +0000 Subject: [PATCH] Non-editing teacher not allowed to change the phase of a Exercise nor delete the teacher's submission(s). --- mod/exercise/locallib.php | 6 ++++-- mod/exercise/view.php | 13 ++++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/mod/exercise/locallib.php b/mod/exercise/locallib.php index e4b8357b0f..15c2bb342f 100644 --- a/mod/exercise/locallib.php +++ b/mod/exercise/locallib.php @@ -772,8 +772,10 @@ function exercise_list_submissions_for_admin($exercise) { foreach ($submissions as $submission) { $action = "id&sid=$submission->id\">". get_string("amendtitle", "exercise").""; - $action .= " | id&sid=$submission->id\">". - get_string("delete", "exercise").""; + if (isteacheredit($course->id)) { + $action .= " | id&sid=$submission->id\">". + get_string("delete", "exercise").""; + } $table->data[] = array(exercise_print_submission_title($exercise, $submission), userdate($submission->timecreated), $action); } diff --git a/mod/exercise/view.php b/mod/exercise/view.php index ccbb7bd54b..733eea876f 100644 --- a/mod/exercise/view.php +++ b/mod/exercise/view.php @@ -352,9 +352,16 @@ $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&action=setupassignment", - "view.php?id=$cm->id&action=openexercise", - "view.php?id=$cm->id&action=makeleaguetableavailable"); + if (isteacheredit($course->id)) { + $tabs->urls = array("view.php?id=$cm->id&action=setupassignment", + "view.php?id=$cm->id&action=openexercise", + "view.php?id=$cm->id&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 { -- 2.39.5