MDL-51128 course: Add startdate for generated course
authorJun Pataleta <jun@moodle.com>
Tue, 13 Oct 2015 02:48:27 +0000 (21:48 -0500)
committerJun Pataleta <jun@moodle.com>
Tue, 13 Oct 2015 02:48:27 +0000 (21:48 -0500)
Added course start date for the course generated by the course
generator in order to prevent incorrect date calculations
(i.e. in assignment due dates) when the generated course is reset.

admin/tool/generator/classes/course_backend.php

index 2c2ca85..0219ebe 100644 (file)
@@ -253,7 +253,8 @@ class tool_generator_course_backend extends tool_generator_backend {
         $courserecord = array(
             'shortname' => $this->shortname,
             'fullname' => $this->fullname,
-            'numsections' => self::$paramsections[$this->size]
+            'numsections' => self::$paramsections[$this->size],
+            'startdate' => usergetmidnight(time())
         );
         if (strlen($this->summary) > 0) {
             $courserecord['summary'] = $this->summary;