Use template on course creation

General plugins (Local) ::: local_course_template
Maintained by Charles Fulton, Andrew Zito
This local plugin allows site administrators to create "template" courses which will be restored into new courses on course creation.
Latest release:
314 sites
306 downloads
52 fans
Current versions available: 6

This local plugin allows site administrators to create "template" courses which will be restored into new courses on course creation. The intended use case is defining common blocks and activities for a given academic term.

Usage

The administrator will need to create a "template" course which contains the desired blocks and resources. This course will need a specially-named short name. By default the plugin will search for a course with the short name Template-[TERMCODE], where [TERMCODE] is the matching value for YYYYYY. For example, if a course had the termcode 201610, the module would search for a course with the short name Template-201610.

The administrator will need to define a regular expression for extracting the term code from the course idnumber. This will be used to identify which course template (if any) should be used on creation. For example, if your courses have idnumbers in the format XXXXXX.YYYYYY, where YYYYYY is the termcode, then the regular expression /[0-9]+\.([0-9]+)/ will return YYYYYY.

The plugin listens on the \core\event\course_created event and fires immediately on course creation. Once you've given a course the necessary short name you don't need to do anything further. The plugin will create a backup of the template course and import it into the new course.

You should consider overriding Moodle's default block settings in config.php: $CFG->defaultblocks_override = '';. Otherwise you will get two sets of blocks on course creation. Manually configure the blocks in the template course instead. 

Screenshots

Screenshot #0

Contributors

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

Comments RSS

Show comments
  • Charles Fulton
    Thu, 18 May 2023, 9:34 PM
  • Blair F.
    Sat, 19 Aug 2023, 6:30 AM
    We've been using this plugin for a while now and, for the most part, it's working as we want. The one thing it's not doing is setting the start/end dates to match those of the template. I've read in forums that it should be using those dates. Instead, all our courses are given "today's date" as the start and empty end dates. If I could figure out a way to get this to work, it would be very helpful.
  • Charles Fulton
    Sat, 19 Aug 2023, 8:43 PM
    Blair, that's actually by design. In our environment, the course start and end dates are set by the import from our SIS, and then the plugin restores resources from the template course but doesn't override the dates. I can see how this could be a useful feature, and I'll track it in https://github.com/LafColITS/moodle-local_course_template/issues/32. You should also take a look at the course dates plugin (https://moodle.org/plugins/tool_coursedates) if you haven't already.
  • Blair F.
    Mon, 21 Aug 2023, 11:25 PM
    Thank you, Charles. I've looked at the course dates plugin, but our courses are not only created in bulk, but then continue to be added every 24 hours after initiated and in different categories. Once created, the instructor does have the ability to enter the exact dates (rather than generic term dates). So, I don't see how I could get this to work smoothly. I appreciate you tracking the issue.
  • Ricardo Caiado
    Fri, 1 Sept 2023, 10:12 PM
    Hi, Charles.

    I've tried several ways and I'm not getting it to work for "GRAD.2023-9".

    What would be the correct regular expression to set in "local_course_template | extracttermcode"?

    Ricardo
  • Charles Fulton
    Sat, 2 Sept 2023, 2:57 AM
    Hi Ricardo, something like /[A-Z]+\.[0-9\-]+/ should work, assuming your idnumbers all follow that same format.
  • Ricardo Caiado
    Mon, 11 Sept 2023, 5:03 AM
    Hi, Charles.

    It worked!

    Thanks.

    Ricardo
  • Ricardo Caiado
    Mon, 18 Sept 2023, 12:48 AM
    Hi, Charles.

    My template course is set to use "Weekly Format", but all my courses are being created in "Topic Format".

    Is this the expected behavior?

    Note: The activities and resources present in the template are copied when creating new courses.

    Ricardo
  • Charles Fulton
    Mon, 18 Sept 2023, 10:04 PM
    Hi Ricardo, that's expected behavior. New courses are still created according to the course creation defaults in site administration, which includes both the course format and the number of topics.
  • Ricardo Caiado
    Mon, 18 Sept 2023, 10:43 PM
    Hi, Charles,

    Thanks for the reply.

    Are the activities and resources created in the template all copied to the new course created? Or is there any restriction?

    Ricardo
  • Charles Fulton
    Mon, 18 Sept 2023, 10:45 PM
    No restriction. If they're in the template course and they're backed up, they should be restored in the new course. The only thing the plugin does is make sure you don't have two copies of the Announcements forum.
  • Bruce Wilbee
    Fri, 5 Apr 2024, 2:15 AM
    We are creeping through our implementation and everything seems to be working well. We are using an external database to handle enrollments and course creation. Has anyone seen anything which will populate course start and end dates based on the dates in the external database?
  • Rob Lowney
    Tue, 4 June 2024, 5:23 PM
    Our Moodle hosting partner has just installed this plugin for us and it seems to be working well, however I've encountered something odd and I wonder if anyone has any suggestions? Our SIS created about 2000 Moodle courses in bulk and as expected this plugin restored a template to each one of the new courses. However for about 400 courses, the template didn't restore fully. Our template has four resources in it (two forums, one book, one URL), and in those 400 courses, only one, two or three of the resources were restored into the course. It's as if the backup failed to restore completely. Has this occurred for anyone else and if so, are you aware of any resolution? Thanks!
  • Charles Fulton
    Tue, 4 June 2024, 9:31 PM
    Hi Rob, that's an odd problem. At our local institution we've done about 800 without that error occurring, although it's possible that it did happen and no one noticed. I'm not sure a partial backup failure would leave any trace in the logs. Any chance your temporary directory was low on disk space during the process?
  • Rob Lowney
    Sun, 23 June 2024, 10:27 AM
    Thanks for the reply Charles - we managed to get to the bottom of it, the issue was actually on the SIS side, not Moodle. We are new to using Banner from Ellucian. We discovered a setting in the console for the Banner-Moodle integration (called "ILP"). If we set the 'concurrency' to the minimum of 1, it seems to create courses on Moodle in a slow and steady manner and allows the plugin to restore the template to each course. So all working well now. Thanks for creating this great plugin, it's going to be crucial for our Moodle rollout each academic year.
1 2 3 4 5
Please login to post comments