Wednesday, June 18, 2014

Moodle - Auto-created courses from external database does not fully replicate the template course

Remember how we setup Moodle to auto create courses with external database (http://iambusychangingtheworld.blogspot.com/2013/06/moodle-using-external-database-for.html)? There is one issue with the template course from which the plugin will apply to the newly created courses, It can only copy the attributes but the blocks layout or labels of the template. Here are what will be replicated:

Clone template:                                                                                                                                           
stdClass Object
(
    [id] => 3
    [category] => 14
    [sortorder] => 130004
    [fullname] => Template
    [shortname] => Template
    [idnumber] => 
    [summary] => 
    [summaryformat] => 1
    [format] => topics
    [showgrades] => 1
    [newsitems] => 5
    [startdate] => 1402419600
    [marker] => 0
    [maxbytes] => 0
    [legacyfiles] => 0
    [showreports] => 0
    [visible] => 1
    [visibleold] => 1
    [groupmode] => 0
    [groupmodeforce] => 0
    [defaultgroupingid] => 0
    [lang] => 
    [calendartype] => 
    [theme] => 
    [timecreated] => 1402372193
    [timemodified] => 1402374966
    [requested] => 0
    [enablecompletion] => 0
    [completionnotify] => 0
    [cacherev] => 1402374967
    [numsections] => 5
    [hiddensections] => 0
    [coursedisplay] => 1
)

To replicate the blocks layout of the template course, we have to do some other things which will be presented in another blog post.