Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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) , and "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:

...

  1. Automatic track-based cohorting – Project Page Auto Track Cohort Defaulting/wiki/spaces/EDUCATOR/pages/120881208
  2. Content Differentiation for Enterprise Learners

...

Older Project Pages