I am sure we will all agree, Cohorts are pretty handy. Recently a new client of mine asked me to do a bulk upload of about 100 users. Once uploaded, the client asked me to add them to a Cohort. No problem. There was only about 110 users on the site, so picking the 100 I needed was easy.
A few days later, I got a similar request. Upload a bunch of users, and then add them to a new Cohort. Suddenly it wasn’t as much fun. Finding and adding them proved to be a little trickier than the first time.
So I decided to tinker about with some code and see what I could come up with.
The screen above shows the following:
- The top left block shows a list of all the Cohorts on the site, as well as the number of Users in each Cohort.
- Below that is a list of Cohorts that have been added to course categories.
- On the bottom right we have all the Cohorts and the courses they have been added to.
Lastly, the screen also has a drop-down list of all the Cohorts. Selecting a Cohort from the list, loads a second screen. On this screen Users can be added or removed.
I wanted to do a few things on the second Cohort Management screen. The most important function was to filter out the Users that had to be added to the Cohort. Ironically, that’s the one part I have not yet completed.
Below are two animations showing how the adding and removing of Users is done.
The image below shows the relationship between the different tables