Course Merge Helper

General plugins (Local) ::: local_course_merge
Maintained by Charles Fulton, Andrew Zito
This local module allows teachers to create a new course shell from existing courses using the Course Meta Link enrollment method.
Latest release:
150 sites
27 fans
Moodle 3.7, 3.8, 3.9, 3.10, 3.11

This local module allows teachers to create a new course shell from existing courses using the Course Meta Link enrollment method. The intended use case is a teacher combining multiple sections of a course into a single course while preserving the enrollments of the original courses. It does not merge the existing contents of courses.

To create a new course go to one of the source courses and click "Create Merged Course" in the Course Administration block. You'll be taken to a page where you can select the other courses to link into the new course, the name and other settings for the new course, and whether to hide the source courses (on by default). Once you've made all your selections click "Create". The plugin will do the following:

  • Create the new course with the given settings
  • Create a course meta link enrollment between each source course and the new course
  • Hide the source courses if requested
  • Take you into the new course


Screenshot #0


Charles Fulton (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Wed, Jun 15, 2016, 11:11 PM
    Hi. I am reviewing your submission on behalf of the Plugins Guardians. The code is well written, and passes all Travis CI checks. Well done! And I see you have included Behat tests as well. That is very helpful.

    One initial concern I have is with the local capability that allows users to gain course creation permissions even if the Moodle site has prevented those users from having those permissions. I see that you have it as a configuration item - whether to allow the plugin to override that capability or not. So that may be enough. I wonder if it would be better to default that capability to use Moodle's standard way rather than the other way around? That way, administrators would have to explicitly know that they had done this.

    I may be misunderstanding what this does. I used it to merge three courses together, each with activities and enrolments. When the new course was created, it didn't have any of the other courses' activities nor enrolments. It just seemed to create a new course as an empty shell. Am I doing something wrong?
  • Wed, Jun 15, 2016, 11:14 PM
    The intention of this plugin is to streamline the creating of a metacourse while preserving the enrollment structure in the child courses. It *should* have brought the enrollments over. Did you have course meta links enabled in your testing environment?
  • Wed, Jun 15, 2016, 11:20 PM
    Additional comment to above... It looks like the "Course meta link" enrolment plugin must be enabled for the users to be enrolled in the new, merged course. When I enabled that plugin, I could see that there were enrolments from all three merged courses into the new course. You may want to have your code check for that enrolment plugin being present and enabled, and provide appropriate error messages if it is not.
    But, there were still no activities from the merged courses. I'm guessing that is correct, and that this plugin is only intended to help create a new course shell with the merged courses' enrollments. Is that correct? It may be best to specify that in the description.
    Thanks again.
  • Wed, Jun 15, 2016, 11:22 PM
    That's correct; it just creates shells. Mike, thanks for all this feedback. I'll add explicit checks for the meta link method and change the permissions handling. I'll also work on the description to make it more explicit what it does.
  • Thu, Jun 16, 2016, 4:36 PM

    Thanks Charles for sharing the plugin with the community, and thanks Mike for providing the detailed peer-review. I agree with Mike - the name of the plugin kind of suggests that the courses will be actually merged into a single one in terms of activities. So it can be the name that is misleading here. But I also see the reasoning that this can be used in a way that the final product looks and feels like a single unit to the student. Fair enough.

    I am happy to approve this plugin now. You are cleared to land, welcome to the Plugins directory.

    p.s. I realised this plugin could play well together with the Subcourse module.

  • Wed, Jun 22, 2016, 11:16 PM
    Thanks everyone, again, for the helpful feedback. I've released a new version which I hope makes it clearer that this plugin creates shells, and I've changed the default permissions model.
  • Thu, May 4, 2017, 6:44 AM
    What does "Hide child courses" actually do? Does it mean only that the course is in a hidden state?
  • Thu, May 4, 2017, 6:48 AM
    "Hide child courses" sets the visibility of the source courses to hidden, instead of visible.
  • Thu, May 18, 2017, 12:27 PM
    Hi! I'm having this error when I an trying to install the plugins.

    Debugging output enabled
    Validating local_course_merge ... Error
    [OK] Name of the plugin to be installed [course_merge]
    Help with Name of the plugin to be installed

    [OK] Plugin version [2016122100]
    [OK] Required Moodle version [2016052300]
    [OK] Full component name [local_course_merge]
    [OK] Declared maturity level [MATURITY_STABLE]
    Help with Declared maturity level

    [OK] Plugin release [v1.1.0]
    [Debug] Found language file [local_course_merge]
    [Error] Write access check [/webapps/apps/app1/public_html/moodle/local]
    Installation aborted due to validation failure

    Hope you can help me with this. Thank you.
  • Thu, May 18, 2017, 7:05 PM
    That sounds like a permissions problem on your web server; it's not related to the plugin. See
  • Fri, Jan 24, 2020, 2:08 AM
    Hi, apologies if this isn't the best place to post, I also asked this on the Moodle forums:

    My question is on how to use the Regex component to standardize the names of the merged courses. The says that there are examples in the settings page of the plugin but that does not seem to be the case for me after installing the plugin on a dev site.

    Can anyone offer any pointers or point me to resources? Note I don't necessarily need help writing a regex, just need to understand how they are applied via this plugin. Many thanks!
  • Tue, Jan 28, 2020, 12:10 AM
    Hi Ben,

    You're quite right; the settings page doesn't contain any real examples. I think I must have copy-pasted text from the course template plugin (which does). Anyway, I've created which does explain how the regex functionality works. Please let me know if you have any further questions.


  • Tue, Jan 28, 2020, 7:49 AM
    Hey Charles, many thanks. That does clarify things. In my case I was missing that I needed to include start and stop characters (/) and use parens to group each element for extraction. Working great for me now!
Please login to post comments