Table of Contents |
---|
Where are Cohorts and Content Groups Stored?
...
Content Groups are a type of UserPartition, and they are defined in a UserPartitionList that is stored on the course module itself (in mongo) via the InheritanceMixin in inheritance.py:
# This is should be scoped to content, but since it's defined in the policy
# file, it is currently scoped to settings.
user_partitions = UserPartitionList(
display_name=_("Group Configurations"),
help=_("Enter the configurations that govern how students are grouped together."),
default=[],
scope=Scope.settings
)
Each UserPartition has a scheme associated with it; the currently defined schemes are "cohort" (for content groups), "random" (for A/B tests), and "verification" (for course re-verification).
Also defined in the InheritanceMixin is group_access, which specifies which UserPartition/group combinations have visibility to the XBlock. The keys are UserPartition ids, and the values are lists of Group ids.
group_access = Dict(
help=_("Enter the ids for the content groups this problem belongs to."),
scope=Scope.settings,
)
In practice, group_access looks like
...
There is a legacy cohort_config dict defined in CourseFields (see below), which is used for migration only to the new model representation.
cohort_config = Dict(
display_name=_("Cohort Configuration"),
help=_(
"Enter policy keys and values to enable the cohort feature, define automated student assignment to "
"groups, or identify any course-wide discussion topics as private to cohort members."
),
scope=Scope.settings
)
The package openedx/course/djangoapps/course_groups contains the majority of the cohort code. The models.py class contains the following SQL models:
...
An internal model used to enforce that a learner can be in only one cohort per course.
CourseUserGroupPartitionGroup
...
- /wiki/spaces/TNL/pages/64061783 (notes capturing discussions about generalizing track-specific content)
- /wiki/spaces/TNL/pages/63406221
- Group-Based Access Control
- Technical architecture for cohorted courseware