Permalink
Browse files

Non-editing teacher not allowed to change the phase of a Exercise nor

delete the teacher's submission(s).
  • Loading branch information...
1 parent eb407d9 commit b14f1130a302a9f67a2218c579fd1fe7975bf0c9 rkingdon committed Oct 17, 2004
Showing with 14 additions and 5 deletions.
  1. +4 −2 mod/exercise/locallib.php
  2. +10 −3 mod/exercise/view.php
@@ -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);
}
View
@@ -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&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 {

0 comments on commit b14f113

Please sign in to comment.