Permalink
Browse files

Non-editing teachers not allowed to change wthe workshop phase nor de…

…lete

teacher submissions.
  • Loading branch information...
1 parent 072dcd8 commit eb407d969fdfd4ef6d4946acb3426116ebfdaef2 rkingdon committed Oct 17, 2004
Showing with 23 additions and 12 deletions.
  1. +4 −2 mod/workshop/locallib.php
  2. +19 −10 mod/workshop/view.php
@@ -1249,8 +1249,10 @@ function workshop_list_submissions_for_admin($workshop, $order) {
$action .= " | <a href=\"assessments.php?action=adminlist&amp;id=$cm->id&amp;sid=$submission->id\">".
get_string("listassessments", "workshop")."</a>";
}
- $action .= " | <a href=\"submissions.php?action=adminconfirmdelete&amp;id=$cm->id&amp;sid=$submission->id\">".
- get_string("delete", "workshop")."</a>";
+ if (isteacheredit($course->id)) {
+ $action .= " | <a href=\"submissions.php?action=adminconfirmdelete&amp;id=$cm->id&amp;sid=$submission->id\">".
+ get_string("delete", "workshop")."</a>";
+ }
$table->data[] = array("<a href=\"submissions.php?action=editsubmission&amp;id=$cm->id&amp;sid=$submission->id\">$submission->title</a>", $course->teacher, $action);
}
print_heading(get_string("studentsubmissions", "workshop", $course->teacher), "center");
View
@@ -84,11 +84,11 @@
if (!isteacher($course->id)) {
error("Only teachers can look at this page");
}
-
- // move to phase 4
- set_field("workshop", "phase", 4, "id", "$workshop->id");
- add_to_log($course->id, "workshop", "assessments only", "view.php?id=$cm->id", "$workshop->id", $cm->id);
- redirect("view.php?id=$cm->id", get_string("movingtophase", "workshop", 4));
+
+ // move to phase 4
+ set_field("workshop", "phase", 4, "id", "$workshop->id");
+ add_to_log($course->id, "workshop", "assessments only", "view.php?id=$cm->id", "$workshop->id", $cm->id);
+ redirect("view.php?id=$cm->id", get_string("movingtophase", "workshop", 4));
}
@@ -394,11 +394,20 @@
"3. ".get_string("phase3", "workshop", $course->student),
"4. ".get_string("phase4", "workshop", $course->student),
"5. ".get_string("phase5", "workshop"));
- $tabs->urls = array("view.php?id=$cm->id&amp;action=setupassignment",
- "view.php?id=$cm->id&amp;action=allowsubmissions",
- "view.php?id=$cm->id&amp;action=allowboth",
- "view.php?id=$cm->id&amp;action=allowassessments",
- "view.php?id=$cm->id&amp;action=makefinalgradesavailable");
+ if (isteacheredit($course->id)) {
+ $tabs->urls = array("view.php?id=$cm->id&amp;action=setupassignment",
+ "view.php?id=$cm->id&amp;action=allowsubmissions",
+ "view.php?id=$cm->id&amp;action=allowboth",
+ "view.php?id=$cm->id&amp;action=allowassessments",
+ "view.php?id=$cm->id&amp;action=makefinalgradesavailable");
+ } else {
+ // non editing teachers cannot change phase
+ $tabs->urls = array("view.php?id=$cm->id",
+ "view.php?id=$cm->id",
+ "view.php?id=$cm->id",
+ "view.php?id=$cm->id",
+ "view.php?id=$cm->id");
+ }
}
if ($workshop->phase) { // phase 1 or more
$tabs->highlight = $workshop->phase - 1;

0 comments on commit eb407d9

Please sign in to comment.