Admin tools: Automatic enrolment in groups

Maintained by OamPascal Maury, Picture of Gemma LesterhuisGemma Lesterhuis, MFreakLuuk Verhoeven
Plugin to auto enrol users in Moodle courses groups
110 sites
12 fans
Current versions available: 2

# Moodle-admin_tool_groupautoenrol

Version 3.9.0 (stable version) for Moodle 3.9.0 Plugin to randomly auto enrol students in Moodle courses groups when they are enrolled into the course (whatever the enrol methods : auto-enrol by key, cohorts sync or manual enrol)

## Things to know :

  • The plugin uses \core\event\user_enrolment_created (user_enrolled) Moodle event 
  • If a selected group is deleted, the plugin will ignore it.

## In this stable version (3.9.0) :

  • GDPR implementation
  • You can choose to enable the plugin in each course
  • You can choose to auto-enrol students in all existing course or specific ones

## Compatibility :

  • Tested with Moodle 3.9
  • Another version of the plugin exist and works with Moodle 2.5 and 2.7 (I did not test it with the others versions but should work with all 2.x). It's a local plugin because adding link into "Course administration" menu was not possible for admin tool before Moodle 3.0. You can get it here :

# Installation

  • Copy the directory 'groupautoenrol' into the `moodledir/admin/tool` directory.
  • Connect to moodle as an administrator and install the plugin.
  • Go to a course, create at least one group
  • Enable the plugin for the course with the new link "Course administration > Users > Auto-enrol in groups"

Note : this link appears even if the plugin is not enabled for the course

# Credits

From Moodle 3.9 onwards this plugin will be maintained by Gemma Lesterhuis, Lesterhuis Training & Consultancy -

Donations for continuous support are welcome.

# Version history :


Screenshot #0
Screenshot #1


Pascal Maury (Lead maintainer)
Picture of Gemma Lesterhuis
Gemma Lesterhuis: New maintainer
Luuk Verhoeven: New Maintainer
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of David Mudrák
    Tue, Apr 5, 2016, 3:58 AM

    Thanks Pascal for the new version of your original local plugin. I noticed couple of issues in the code that you will want to have fixed in a future update of the plugin to make it translatable via AMOS. Please see details in your bug tracker. You are cleared to land now, welcome to the Plugins directory!

  • Oam
    Tue, Apr 12, 2016, 12:30 AM
    I fixed the problem ! smile
  • Picture of Dinis Medeiros
    Wed, Apr 13, 2016, 5:45 AM
    Thank YOU! smile
  • Picture of Anthan Ren
    Mon, May 23, 2016, 1:56 PM
    Is there any possible to enrollment automatically from external database?
  • Oam
    Mon, May 23, 2016, 4:02 PM
    Hello Anthan Ren,
    I never used external database, so I am not planning to work on enrollment automatically from external database for now, sorry. You can improve my code in this way smile
  • Picture of Janice Johnson
    Wed, Feb 15, 2017, 7:14 AM
    Hello - I have the plugin working on moodle 3.0x, and everything is working fine. I just don;t understand how the plugin assigns students to groups.

    I need students to be assigned to specific groups, and I have a table in an external database that contains the groups and students names. Can you tell me how this plugin assigns groups, so that I can augment for my use?
  • Oam
    Wed, Feb 15, 2017, 5:31 PM
    My plugin does not match your need. See my answer here :
  • Picture of John Anderson
    Tue, Jul 3, 2018, 3:20 AM
    Only random groups? Can I set it to just one? A specific group?
  • Oam
    Tue, Jul 3, 2018, 10:05 PM
    Yes, you can choose only one group.
    Note : I have no idea if my plugin still works with Moodle > 3.0.
    You have to test it first !
  • Picture of Thomas Robb
    Fri, Jul 17, 2020, 3:54 PM
    I would like new users to be automatically assigned to a group based on their country. Right now, I only see "Department, Institution, City & Preferred language. Would it be difficult to add "Country" to the list of profile fields? I'd be willing to pay a modest sum to have this implemented.
  • Picture of Gemma Lesterhuis
    Fri, Aug 21, 2020, 3:26 PM
    @thomas, if you want to use a profile field for group maybe this plugin is what you seek:
  • Picture of Gemma Lesterhuis
    Fri, Aug 21, 2020, 3:32 PM
    @pascal I have contracted a developer to update this plugin voor Moodle 3.9, we would like to publish this to, on this page. Could you please contact me on the best way to move forward?
  • Oam
    Fri, Aug 21, 2020, 4:03 PM
    Thank you Gemma for answering Thomas' question. Indeed, my plugin can not automatically assigtn users to a group based on their user profile information.
    No problem for updating this plugin, I have not time to update it anymore. I sent you a "contact request".
  • Picture of Gemma Lesterhuis
    Fri, Aug 21, 2020, 6:16 PM
    Just replied to the contact request. From what I understand you can add the successor to the plugin page with all the premissions. In my message I mentioned the names smile If you could arrange that, that would be great. Thank you
1 2
Please login to post comments