Hi
Right now I am trying to enrol a user to a course and a specific group within that course with the API.
Is that possible?
RIght now I can enrol the user to the course no problem but I don't know how to enroll the user to a group also.
Relevant code is this
$plugin_instance = $DB->get_record("enrol", array('courseid'=>$return_data["user2"], 'enrol'=>'manual'));
$plugin = enrol_get_plugin('manual');
$plugin->enrol_user($plugin_instance, $return_data["user1"], $plugin_instance->roleid);