Dynamic cohorts

Administration tools ::: tool_dynamic_cohorts
Maintained by Dmitrii Metelkin, Catalyst IT
Dynamic cohorts plugin allows dynamically add and remove users from cohorts based on configured rules, which themselves are composed of conditions.
Latest release:
1681 sites
787 downloads
55 fans
Current versions available: 2

Dynamic cohorts plugin allows dynamically add and remove users from cohorts based on configured rules, which themselves are composed of conditions.

For users to be added to the cohort specified by a rule, they must match all of rule's conditions (logical operator AND) or any of rule's conditions (logical operator OR).

Built-in conditions

  • Authentication method (Manual, SAML and etc)
  • Cohort fields (if a user is a member of cohort(s) matching specific cohort fields like cohort name, context, custom fields and etc)
  • Cohort membership (if a user is a member of cohort(s)).
  • Course completed (if a user has completed a course).
  • Course not completed (if a user has not completed a course).
  • User created time (time since a user was created).
  • User custom profile fields (text, menu, date and autocomplete types are supported).
  • User enrolment (if a user is enrolled into a course).
  • User last login (time since a user last logged in).
  • User role (if a user has a role in a given context)
  • User standard profile fields (e.g. first name, last name, username, auth method and etc).
  • User interests (tags) (if a user has a specific interest tagged on their profile).

Please see README file for details about the usage and features of this plugin.

Similar plugins

There are similar plugins that can add users to cohorts dynamically based on user profile fields.

However, "Dynamic cohorts" plugin gets this all to the next level as it provides an API for other plugins to implement pretty much any condition that can limit users from mdl_user table by SQL.

Warm thanks

Plugin funded by Murdoch University, Perth, Western Australia

Logo

Screenshots

Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3
Screenshot #4

Contributors

Dmitrii Metelkin (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments

Показване на коментарите
  • András Bertalan Kiss
    пн, 31 март 2025, 20:04
    Very good plugin, sadly it cant see the custom profile fields.. can you solve that?
  • Ricardo Caiado
    пн, 31 март 2025, 20:56
    HI, András.

    I am using this plugin and I can see all the custom profile fields.

    Ricardo
  • Monika Jenkins
    ср, 2 апр 2025, 05:20

    Is there a plan to maybe add on to this plugin to include other conditions, such as relative expiration dates, with either "inactivate this dynamic rule 2 months from creation/today,". I think many of us are using this wonderful too in conjunction with cohort sync which lacks expiration dates. In our case, we need to be able to have cohorts or rules be individually managed at customer level, not course level, ideally through fixed or relative dates.
  • Dmitrii Metelkin
    вт, 8 апр 2025, 07:33
    Hi Monika,
    Please don't hesitate to raise your request in github as we manage all feature requests there. See https://github.com/catalyst/moodle-tool_dynamic_cohorts/issues
  • Estelle Lesperrier
    пн, 7 юли 2025, 18:07
    Thanks a lot for this plugin. Is there a limited number of conditions I can add within one rule?
  • Shan Lin
    ср, 30 юли 2025, 15:03
    Hi there Dmitrii,
    Will this plugin work in allowing users who self-register using using an email with certain pre-vetted domains (for example @businessname.com) to be automatically added to a cohort? The goal is to avoid manual assignment of users from a list of organisations to certain cohorts.
  • Al
    чт, 7 авг 2025, 04:45
    Hi
    I hope you are well, it's been ages. Dynamic Cohort appears to work on Moodle 5. Could you update the supported extension on your end to Moodle 5 so that it installs automatically each week when we update our Moodle instance? It saves us so much time. Cheers.
  • Chris Canning
    пт, 15 авг 2025, 20:46
    Hi,

    Does this cohort plugin have conditions for you to omit users when their accounts have been suspended?
  • Christian Grauer
    пн, 8 сеп 2025, 01:27
    Hi, i'd like to use custom profile fields for some conditions, but they are not listed in the select box. Shouldn't they?
  • Hanna Kubrak
    ср, 17 сеп 2025, 21:51
    Hi everyone,

    This is an absolutely brilliant plugin! Many thanks to the contributors!

    I'm wondering if there's a technical or practical limit to how many conditions can be combined with 'OR' in a single rule. I want to include users whose email address ends with one of over 50 different domains.
    Would it be better to split this into multiple rules, each with fewer conditions?

    Thanks in advance,
    Hanna
  • Céline Deswarte
    пн, 22 сеп 2025, 16:44
    Hello,
    I need help setting up the Excel spreadsheet in CSV format, please.
    I can't filter by cohort custom fields.
    I need to be able to register users according to their institution, department, and function.
    The Excel column headings are lastname, firstname, username, email, password, cohort (for the institution), profile_field_function, profile_field_service.
    Can you point me to my errors?
    Thank you for your help.
    Céline
  • Iago París Fernández
    сб, 18 окт 2025, 16:06
    Hello

    I can't install the Moodle 4.1 version. It raises an "Exception - Class "ZipArchive" not found" error
  • Magalí Lescano Correa
    пн, 26 яну 2026, 23:19
    Hello,

    Thank you for the plugin, it is very helpful.

    I’m having an issue with Dynamic Cohorts on Moodle 4.5.4+ (Build: 20250516) using plugin version 2025102000.

    When I go to Manage rules and click “Add a new rule”, I get a 404 Not Found error.

    I’ve already opened an issue in the bug tracker with more details.

    Could you please help me?

    Thank you.
  • Andrea Briganti
    чт, 19 фев 2026, 22:02
    Hello, I just installed the plugin on a Moodle 5.0.3+. Creating a rule via custom profile field is not possible. The list of additional fields is not visible. Only the field Firstname is available. Can you pls help? Thanks Andres
  • Form SSE
    пт, 6 март 2026, 17:17
    Hello Andrea,
    i don't know if you are in a similar config as one of our platforms (running on 4.5.10): only 5 types of custom fileds are handled : text, menu, autocomplete, checkbox, datetime.
    Just after installation i tried the plugin and don't have any possible fields in custom profile field of the allowed type. After addding possible fields it works well.

    Just a comment to developers: should it be possible to mix AND /OR conditions (shouldbe more complex to handled but nice to have!)

    Thanks
1 2
Please login to post comments