An embeddable xblock that will simply allow a user to self-select their cohort in a course.
Access the LMS/CMS docker container:
docker exec -it tutor_local_lms_1 /bin/bash # For LMS
docker exec -it tutor_local_cms_1 /bin/bash # For CMSClone the Cohort Selector repository here:
git clone https://github.com/jswope00/cohort-selector-xblock.gitAccess the Cohort Selector directory:
cd cohort-selector-xblock/Install this using the following command:
pip install -e .To upgrade an existing installation of this XBlock, fetch the latest code and then update:
git pull origin master
cd ..
pip install -U --no-deps cohort-selector-xblock/Access the edx-platform/openedx/core/djangoapps/course_groups/views.py file.
Find the function def add_users_to_cohort(request, course_key_string, cohort_id):
Under the function, perform the following change:
get_course_with_access(request.user, 'staff', course_key)Replace 'staff' with 'load'
get_course_with_access(request.user, 'load', course_key)Restart the Server:
tutor local restartNote: Installation and Configuration steps are to be done for LMS and CMS both.
You can enable the cohort-selector-xblock in studio through the advanced settings.
- From the main page of a specific course, navigate to
Settings -> Advanced Settingsfrom the top menu. - Check for the
advanced_modulespolicy key, and add"cohortxblock"to the policy value list. - Click the "Save changes" button.