]> git.mjollnir.org Git - moodle.git/commitdiff
keeping time information when student becomes teacher
authorgustav_delius <gustav_delius>
Sat, 4 Sep 2004 13:23:08 +0000 (13:23 +0000)
committergustav_delius <gustav_delius>
Sat, 4 Sep 2004 13:23:08 +0000 (13:23 +0000)
lib/moodlelib.php

index edf88979d06e318a73988d1e0f16cf95df08b864..9e149615a3e527ba1a7395b86dc644318b947c70 100644 (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;