Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Classes | Functions | Variables
lib.php File Reference

Cohort enrolment plugin. More...

Classes

class  enrol_cohort_plugin
 Cohort enrolment plugin implementation. More...
 

Functions

 cohort_add_cohort ($cohort)
 Add new cohort. More...
 
 cohort_add_member ($cohortid, $userid)
 Add cohort member. More...
 
 cohort_can_view_cohort ($cohortorid, $currentcontext)
 Check if cohort exists and user is allowed to access it from the given context. More...
 
 cohort_delete_category ($category)
 Somehow deal with cohorts when deleting course category, we can not just delete them because they might be used in enrol plugins or referenced in external systems. More...
 
 cohort_delete_cohort ($cohort)
 Delete cohort. More...
 
 cohort_edit_controls (context $context, moodle_url $currenturl)
 Returns navigation controls (tabtree) to be displayed on cohort management pages. More...
 
 cohort_get_all_cohorts ($page=0, $perpage=25, $search='')
 Get all the cohorts defined anywhere in system. More...
 
 cohort_get_available_cohorts ($currentcontext, $withmembers=0, $offset=0, $limit=25, $search='')
 Returns the list of cohorts visible to the current user in the given course. More...
 
 cohort_get_cohort ($cohortorid, $currentcontext)
 Get a cohort by id. More...
 
 cohort_get_cohorts ($contextid, $page=0, $perpage=25, $search='')
 Get all the cohorts defined in given context. More...
 
 cohort_get_list_of_themes ()
 Returns a list of valid themes which can be displayed in a selector. More...
 
 cohort_get_user_cohort_theme ($userid)
 Get the user cohort theme. More...
 
 cohort_get_user_cohorts ($userid)
 Get all the cohorts where the given user is member of. More...
 
 cohort_is_member ($cohortid, $userid)
 Is this user a cohort member? More...
 
 cohort_remove_member ($cohortid, $userid)
 Remove cohort member. More...
 
 cohort_update_cohort ($cohort)
 Update existing cohort. More...
 
 core_cohort_inplace_editable ($itemtype, $itemid, $newvalue)
 Implements callback inplace_editable() allowing to edit values in-place. More...
 
 enrol_cohort_allow_group_member_remove ($itemid, $groupid, $userid)
 Prevent removal of enrol roles. More...
 
 enrol_cohort_create_new_group ($courseid, $cohortid)
 Create a new group with the cohorts name. More...
 

Variables

const COHORT_ALL 0
 
const COHORT_COUNT_ENROLLED_MEMBERS 3
 
const COHORT_COUNT_MEMBERS 1
 
const COHORT_CREATE_GROUP -1
 COHORT_CREATEGROUP constant for automatically creating a group for a cohort.
 
const COHORT_WITH_ENROLLED_MEMBERS_ONLY 17
 
const COHORT_WITH_MEMBERS_ONLY 5
 
const COHORT_WITH_NOTENROLLED_MEMBERS_ONLY 23
 

Detailed Description

Cohort enrolment plugin.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later