MDL-39764 course_format: Allow courses to have numsections > maxsections.

This commit is contained in:
Gareth J Barnard
2013-06-04 00:07:46 +01:00
parent ee2e56ee9e
commit d49e53b39f
+10
View File
@@ -130,6 +130,16 @@ class course_edit_form extends moodleform {
if (!isset($max) || !is_numeric($max)) {
$max = 52;
}
/*
* Increase the number of sections combo box values if the user has increased the number of sections
* using the icon on the course page beyond course 'maxsections' or course 'maxsections' has been
* reduced below the number of sections already set for the course on the site administration course
* defaults page. This is so that the number of sections is not reduced leaving unintended orphaned
* activities / resources.
*/
if (isset($course->numsections) && $course->numsections > $max) {
$max = $course->numsections;
}
for ($i = 0; $i <= $max; $i++) {
$sectionmenu[$i] = "$i";
}