* @return boolean
* @todo Finish documenting this function
*/
-function enrol_student($userid, $courseid, $timestart=0, $timeend=0, $enrol='manual') {
+function enrol_student($userid, $courseid, $timestart=0, $timeend=0, $enrol='') {
global $CFG;
enrol_student($userid, $parent->parent_course,$timestart,$timeend,$enrol);
}
}
+
+ if (empty($enrol)) {
+ $enrol = $CFG->enrol; // Default current method
+ }
if ($student = get_record('user_students', 'userid', $userid, 'course', $courseid)) {
$student->timestart = $timestart;
$student->timeend = $timeend;