Self-assigned cohorts

Hello community!

I perused the docs and failed to find a way to let learners self-assign into a cohort.
It’s for an open course which is tailored for two different target audiences, which would run for two or three years without supervision, hence the need to automate cohort assignment without admin intervention.

Is this feature unavailable in open edX?
Is there an add-on feature that could do it?

I am thinking of breaking up the course in two clones tailored for one audience each as a backup option.

Hi Vincent - I’ve always wanted a way to allow self-cohorting in MOOCs and the closest option has been to create Teams… Hopefully there is an add-on in the Open edX world.


Sorry I’m just seeing this after 4 months. We built a cohort selector block a while back for this purpose.

It’s a few versions old, so it’ll probably need some work to be compatible with Maple. And it does require a tweak to one file in Open EdX, since cohorts are originally designed in Open Edx to only be editable by staff members. But have at it if you like!


@john_curricume I’m interested in using this. Do you have any sense of what kind of work will be required to make it work with Nutmeg? (I.e. I can just try it as-is, but then I’m not sure what I’ll need to know to debug anything that goes wrong…)

Yeah, I tried doing all the steps for Nutmeg, but at the end I just don’t have any new component show up under Advanced when I try to add it to the class (and yes I added it under Advanced Settings, changed the source code, and enabled ALLOW_ALL_ADVANCED_COMPONENTS via a tutor plugin like:

name: cohort_self_select
version: 0.1.0
    cms-env: |

which I confirmed shows up in

/home/ubuntu/.local/share/tutor/env/apps/openedx/config/cms.env.yml:"ALLOW_ALL_ADVANCED_COMPONENTS": True


@Rohan I’ll give it a shot to bring it in line with Nutmeg. I’ll aim to get back to this thread by next Wednesday with an update.

1 Like

That is super-appreciated! Thanks!

@Rohan this has been updated now. Give it a shot and let me know how it goes!


I was able to get the xblock showing up now!

But I’ve got a question about the “Access the LMS/CMS docker container:” steps. Don’t these containers get rebuilt every time someone does “tutor images build openedx”? And therefore wouldn’t this checked out copy inside the container get removed in the future?

I’m already using a custom invocation of

tutor images build openedx --build-arg EDX_PLATFORM_REPOSITORY= --build-arg EDX_PLATFORM_VERSION=my_branch_with_changes

In order to persist the suggested changes to edx-platform/openedx/core/djangoapps/course_groups/ (and I recommend changing the instructions to recommend other people do the same), but that would still leave needing to find a way to automatically install the plugin. Are you aware of any way to do this? Or am I off-base that it will not persist?

Also, once I tried to use the cohort selection from a student account, I encountered two issues:

The first is that the naming of cohorts doesn’t seem to be alphabetical, as shown below:

Is there a way or change that can be made to enforce alphabetical ordering here? I can just rename cohorts to fit the ordering (which is the same as what’s show on the Instructor → Cohorts page), but I just thought I would ask.

The second issue is more critical. When I log in as a beta tester student, I see that they were correctly assigned to Cohort3 which is what I have set for the “Automatic” enrollment (i.e. the default enrollment.) The Cohort1 and Cohort2 are set to manual enrollment (but let me know if that’s not correct.) When my student user selects Cohort1 for themselves, first of all there’s no “submit” of any sort which seems a little suspicious.


But the issue is that if the student then goes to the next unit, and then comes back to the previous unit, the cohort self-selection has disappeared:

Just incase maybe it was un-enrolling the student on going back to that page, I then went back and selected Cohort2, and then moved forward. But when I went and downloaded student data, the student was still set to the Cohort3, not Cohort2, which basically seems to suggest that the change isn’t persisting. Any thoughts on why this may be?

@john_curricume is this the expected behavior for the 2nd issue?

@Rohan I was on vacation but am back now and spoke to my dev team about it. There are more changes in Nutmeg that require additional customizations to the code for this to work. We aren’t sure what all of them are but we’ll be researching it to get this block working (we want it for ourselves too). Not sure exactly when we’ll have those turned around but should know more soon.

This is very much appreciated, thank you!

Hey Rohan,
Updates made, so the cohort selection should persist now.
There is no submit button, it just recognizes that the user made a selection and shows the confirmation message like the following:

Let me know if it is now working on your system.

@john_curricume no luck :frowning: I don’t see any green confirmation text like that when selecting from a student account still, and they can’t see the cohort-restricted content.

First I tried upgrading via

git pull origin master
cd ..
pip install -U --no-deps cohort-selector-xblock/
tutor local restart

And while it said the reinstall succeeded, that didn’t change the observed behavior. So then I went to rebuild my open edx image incase that was needed, but it seemed to say that everything was fine and still could use the cache. Then I did a “tutor local quickstart” but the result was the same as the local restart; no green text or changed behavior.

Any guidance on further debugging steps/logs I can check for?

Hey @Rohan, a couple things potentially:

  1. Did you make the modification to that is mentioned in the README?
  2. Any errors in logs or console that you can share?
    Let me know!

Re, yep, I mentioned my custom build command that references a fork w/ the changes.

Re errors in logs, I’d need to know what to search for? (Also FYI I’m going to be out for work for a couple weeks and may be delayed in replying after today.)