Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Redirect teachers to course after coursecreation.

  • Loading branch information...
commit d7466bdecb1dcbc3f4b6d5da6ae606611f7cc89b 1 parent 44996d0
paca70 authored
Showing with 10 additions and 5 deletions.
  1. +10 −5 course/edit.php
View
15 course/edit.php
@@ -63,12 +63,17 @@
$teacher[course] = $newid;
$teacher[authority] = 1; // First teacher is the main teacher
- $mainteacher = insert_record("user_teachers", $teacher);
- if (!$mainteacher) {
- error("Could not add main teacher to new course!");
- }
+ $mainteacher = insert_record("user_teachers", $teacher);
+ if (!$mainteacher){
+ error("Could not add main teacher to new course!");
+ }
- redirect("teacher.php?id=$newid", get_string("changessaved"));
+ if (isadmin()){ //redirect admin to add teachers
+ redirect("teacher.php?id=$newid", get_string("changessaved"));
+ } else { //redirect teachers to course
+ redirect("$CFG->wwwroot/course/view.php?id=$newid", get_string("changessaved"));
+ }
+
} else {
error("Serious Error! Could not create the new course!");
}
Please sign in to comment.
Something went wrong with that request. Please try again.