Skip to content
Browse files

MDL-29290 Enrol IMSEnterprise - use correct course defaults - thanks …

…to Adam Barbary for the fix
  • Loading branch information...
1 parent 6be90ce commit cffd976ee30da356e2d41ffc225cee267e3ab40a @danmarsden danmarsden committed Nov 8, 2011
Showing with 13 additions and 3 deletions.
  1. +13 −3 enrol/imsenterprise/lib.php
View
16 enrol/imsenterprise/lib.php
@@ -356,12 +356,23 @@ function process_group_tag($tagcontents){
$this->log_line("Course $coursecode not found in Moodle's course idnumbers.");
} else {
// Create the (hidden) course(s) if not found
+ $courseconfig = get_config('moodlecourse'); // Load Moodle Course shell defaults
$course = new stdClass();
$course->fullname = $group->description;
$course->shortname = $coursecode;
$course->idnumber = $coursecode;
- $course->format = 'topics';
- $course->visible = 0;
+ $course->format = $courseconfig->format;
+ $course->visible = $courseconfig->visible;
+ $course->numsections = $courseconfig->numsections;
+ $course->hiddensections = $courseconfig->hiddensections;
+ $course->newsitems = $courseconfig->newsitems;
+ $course->showgrades = $courseconfig->showgrades;
+ $course->showreports = $courseconfig->showreports;
+ $course->maxbytes = $courseconfig->maxbytes;
+ $course->groupmode = $courseconfig->groupmode;
+ $course->groupmodeforce = $courseconfig->groupmodeforce;
+ $course->enablecompletion = $courseconfig->enablecompletion;
+ $course->completionstartonenrol = $courseconfig->completionstartonenrol;
// Insert default names for teachers/students, from the current language
$site = get_site();
@@ -388,7 +399,6 @@ function process_group_tag($tagcontents){
}
$course->timecreated = time();
$course->startdate = time();
- $course->numsections = 1;
// Choose a sort order that puts us at the start of the list!
$course->sortorder = 0;

0 comments on commit cffd976

Please sign in to comment.
Something went wrong with that request. Please try again.