Task: To improve our Moodle Course management
Tools: Moodle Plugin "local_course_templates", Moosh, and config.php
We currently use Moosh (https://moosh-online.com/) to create accounts, courses, and course enrollments.
Information from our Campus Solution Software gets sent over to one of our Moodle Web servers which has a moodlecron running to run user adds, user/course enrolls, and course creations.
- Our course creation bash script is run by moodlecron every 15 minutes. The contents of the file follows the pattern below.
- ( /usr/local/moosh/moosh.php -n --verbose -p /var/www/html course-create -c $categoryID -F 'topcoll' -i 'UNIV10001_F18' -f '$CourseFullName (UNIV10001_F18)' -v 'n' 'UNIV10001_F18' )
When moodle receives the "Create Course" trigger from our moosh process it looks to config.php first to see if there is any "default block overrides". We currently have our's set to ($CFG->defaultblocks_override = '';) because we do not want duplicate blocks added to new courses.
- Install the local_course_templates plugin. Instructions are found here (https://moodle.org/plugins/local_course_templates)
- In the "Administration" block go to "Site Administration -> Plugins -> Local plugins -> Use template on course creation"
- In the "Term Code" field please enter in your own Regex.
- We name our courses based off Course-Short-Name, Section, Semester, and Year. (i.e. UNIV10001_F18)
- So our Term Code is "/[A-Za-z0-9]+\_([A-Z]+[0-9]+)/" and our "Template shortname format" is "Template-[TERMCODE]"
- Create a new category called "Semester Templates"
- Add a new course named "Template-Semester/Year" (i.e. Template-F18)
- Modify the course template to your liking. This includes blocks, activities, course formats, etc.
- Once the course template is ready you will need to clear moodle's cache ("Site Administration → Development → Purge All Caches")
- The next time a course is created and it has your custom Regex (i.e. UNIV10001_F18) it should apply the "Template-F18" template to your course.