From: gustav_delius Date: Sat, 4 Sep 2004 13:23:08 +0000 (+0000) Subject: keeping time information when student becomes teacher X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=5a2dea02dc2bcef26a89cb5eeaf113101b1869a1;p=moodle.git keeping time information when student becomes teacher --- diff --git a/lib/moodlelib.php b/lib/moodlelib.php index edf88979d0..9e149615a3 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -932,6 +932,14 @@ function add_teacher($userid, $courseid, $editall=1, $role="", $timestart=0, $ti $teacher->course = $courseid; $teacher->editall = $editall; $teacher->role = $role; + $teacher->timemodified = time(); + $newteacher->timestart = $timestart; + $newteacher->timeend = $timeend; + if ($student = get_record("user_students", "userid", $userid, "course", $courseid)) { + $teacher->timestart = $student->timestart; + $teacher->timeend = $student->timeend; + $teacher->timeaccess = $student->timeaccess; + } if (record_exists("user_teachers", "course", $courseid)) { $teacher->authority = 2;