Cohorts: Difference between revisions
(→Goals) |
m (spelling error only) |
||
(25 intermediate revisions by 3 users not shown) | |||
Line 2: | Line 2: | ||
{{Infobox Project | {{Infobox Project | ||
|name = Cohorts | |name = Cohorts | ||
|state = | |state = Work in progress | ||
|tracker = MDL-21781 | |tracker = MDL-21781 | ||
|discussion = n/a | |discussion = n/a | ||
Line 8: | Line 8: | ||
}} | }} | ||
{{Moodle 2.0}} | {{Moodle 2.0}} | ||
=Goals= | =Goals= | ||
Site-wide groups (aka cohorts) is one of the most requested missing features. | Site-wide groups (aka cohorts) is one of the most requested missing features. | ||
Line 14: | Line 13: | ||
# Cohort enrolment plugin - new enrolment plugin synchronising users in cohort with enrolments in a course (including role assignment and group membership) | # Cohort enrolment plugin - new enrolment plugin synchronising users in cohort with enrolments in a course (including role assignment and group membership) | ||
# Synchronisation with external systems - some external systems do not know the actual courses, they only contain some user groups, at present we do not have a simple way to reuse these groups in Moodle. | # Synchronisation with external systems - some external systems do not know the actual courses, they only contain some user groups, at present we do not have a simple way to reuse these groups in Moodle. | ||
# Partially replace meta courses | # Partially replace meta courses | ||
# Replace category enrolments - category enrolments have major design issues and are not compatible with | # Replace category enrolments - category enrolments have major design issues and are not compatible with incoming enrolment changes. | ||
=DB tables= | =DB tables= | ||
Table ''cohort'' definition of site-wide groups (aka cohorts) | Table ''cohort'' definition of site-wide groups (aka cohorts) | ||
{| class="wikitable" | |||
{| class=" | |||
! Field | ! Field | ||
! Type | ! Type | ||
Line 38: | Line 34: | ||
|- | |- | ||
| name | | name | ||
| char( | | char(254) | ||
| | | | ||
| name of cohort | | human readable cohort name | ||
|- | |||
| '''idnumber''' | |||
| char(100) | |||
| | |||
| unique identifier of the cohort, can be used in external systems | |||
|- | |- | ||
| description | | description | ||
Line 46: | Line 47: | ||
| | | | ||
| longer description | | longer description | ||
|- | |||
| descriptionformat | |||
| int(2) | |||
| | |||
| text format | |||
|- | |||
| component | |||
| char(100) | |||
| | |||
| component name of a plugin responsible for assignment of users (ex: auth_ldap, etc.), NULL means manual assignments | |||
|- | |- | ||
| timecreated | | timecreated | ||
Line 57: | Line 68: | ||
| timestamp, last modification | | timestamp, last modification | ||
|} | |} | ||
Context specified can be system or course category level, defining of cohort a course context would not make much sense. | Context specified can be system or course category level, defining of cohort a course context would not make much sense. | ||
Table ''cohort_members'' stores cohort members | Table ''cohort_members'' stores cohort members | ||
{| class="wikitable" | |||
{| class=" | |||
! Field | ! Field | ||
! Type | ! Type | ||
Line 89: | Line 98: | ||
| timestamp, when added | | timestamp, when added | ||
|} | |} | ||
=New capabilities= | =New capabilities= | ||
* moodle/cohort:assign | * moodle/cohort:assign - add/delete members (only for manual assignment cohorts with source == null) | ||
* moodle/cohort:manage | * moodle/cohort:manage -add/delete/move cohorts | ||
* moodle/cohort:view | * moodle/cohort:view - view membership and use cohort elsewhere | ||
Context id defined in cohort table is used for access control only, the cohort may be actually used in any context (this may happen when moving courses, categories or cohorts). | Context id defined in cohort table is used for access control only, the cohort may be actually used in any context (this may happen when moving courses, categories or cohorts). | ||
=User interface= | =User interface= | ||
# Cohort edit link in CONTEXT_SYSTEM and each CONTEXT_COURSECAT- most probably from the settings block | # Cohort edit link in CONTEXT_SYSTEM and each CONTEXT_COURSECAT- most probably from the settings block | ||
Line 103: | Line 109: | ||
# New options in group creation UI | # New options in group creation UI | ||
# New options for sync with external groups in auth or enrol plugins | # New options for sync with external groups in auth or enrol plugins | ||
=Implementation steps= | |||
# add db tables and cohort membership UI | |||
# add option to assign role to all cohort users (one time only, no sync) | |||
# enrolment rewrite | |||
# cohort enrolment plugin | |||
=Upgrade= | =Upgrade= | ||
Cohorts are designed to replace course category enrolments because the new enrolment plugin is not compatible with this. | |||
=See also= | =See also= | ||
* [[Enrolment rewrite and role tweaks proposal]] | * [[Enrolment rewrite and role tweaks proposal]] | ||
* [[New permissions evaluation in 2.0]] | * [[New permissions evaluation in 2.0]] | ||
* [[New permission overriding UI]] | * [[New permission overriding UI]] | ||
* [[New enrolments in 2.0]] | |||
[[Category:Roles]] | [[Category:Roles]] |
Latest revision as of 12:23, 7 January 2022
Note: This page is a work-in-progress. Feedback and suggested improvements are welcome. Please join the discussion on moodle.org or use the page comments.
Cohorts | |
---|---|
Project state | Work in progress |
Tracker issue | MDL-21781 |
Discussion | n/a |
Assignee | Petr Škoda (škoďák) |
Moodle 2.0
Goals
Site-wide groups (aka cohorts) is one of the most requested missing features.
- Simplify manual enrolments - instead of enrolling students one by one, it would be possible to enrol a cohort with single click.
- Cohort enrolment plugin - new enrolment plugin synchronising users in cohort with enrolments in a course (including role assignment and group membership)
- Synchronisation with external systems - some external systems do not know the actual courses, they only contain some user groups, at present we do not have a simple way to reuse these groups in Moodle.
- Partially replace meta courses
- Replace category enrolments - category enrolments have major design issues and are not compatible with incoming enrolment changes.
DB tables
Table cohort definition of site-wide groups (aka cohorts)
Field | Type | Default | Description |
---|---|---|---|
id | int(10) | auto-incrementing | |
contextid | int(10) | foreign key, references context.id | |
name | char(254) | human readable cohort name | |
idnumber | char(100) | unique identifier of the cohort, can be used in external systems | |
description | text | longer description | |
descriptionformat | int(2) | text format | |
component | char(100) | component name of a plugin responsible for assignment of users (ex: auth_ldap, etc.), NULL means manual assignments | |
timecreated | int(10) | timestamp, creation date | |
timemodified | int(10) | timestamp, last modification |
Context specified can be system or course category level, defining of cohort a course context would not make much sense.
Table cohort_members stores cohort members
Field | Type | Default | Description |
---|---|---|---|
id | int(10) | auto-incrementing | |
cohortid | int(10) | foreign key, references cohort.id | |
userid | int(10) | foreign key, references user.id | |
timeadded | int(10) | timestamp, when added |
New capabilities
- moodle/cohort:assign - add/delete members (only for manual assignment cohorts with source == null)
- moodle/cohort:manage -add/delete/move cohorts
- moodle/cohort:view - view membership and use cohort elsewhere
Context id defined in cohort table is used for access control only, the cohort may be actually used in any context (this may happen when moving courses, categories or cohorts).
User interface
- Cohort edit link in CONTEXT_SYSTEM and each CONTEXT_COURSECAT- most probably from the settings block
- Option for manual cohort enrolment - part of new enrolment UI
- New UI in cohort enrolment plugin
- New options in group creation UI
- New options for sync with external groups in auth or enrol plugins
Implementation steps
- add db tables and cohort membership UI
- add option to assign role to all cohort users (one time only, no sync)
- enrolment rewrite
- cohort enrolment plugin
Upgrade
Cohorts are designed to replace course category enrolments because the new enrolment plugin is not compatible with this.