Created
July 14, 2017 09:52
-
-
Save xyulex/0e60f50a5e5f9b3fae9f2e44272b1dc6 to your computer and use it in GitHub Desktop.
MOODLE: Enrol user as a student
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$plugin_instance = $DB->get_record("enrol", array('courseid' => $courseid, 'enrol'=>'manual')); | |
$plugin = enrol_get_plugin('manual'); | |
$roleid = $DB->get_field('role', 'id', array('shortname' => 'student')); | |
$plugin->enrol_user($plugin_instance, $userid, $roleid); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Matricula un usuario con el rol de estudiante en un curso determinado.