keeping time information when student becomes teacher

This commit is contained in:
gustav_delius
2004-09-04 13:23:08 +00:00
parent c5e6911b28
commit 5a2dea02dc
+8
View File
@@ -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;