In the default course settings, setting the maximum number topics / weeks to 0 would not
change the default number of sections on the same page as any other number would.
A more appropriate check has been put in place.
This also incorporates a fix for MDL-28584. The course edit screen now also checks to see
if maxsections is set or numeric. If it is not set or numeric then it defaults to 52.
- Fields added to format_legacy as default course format options;
- Upgrade script copies fields values from table course to course_format_options;
- Fields removed from table course;
- Fields removed from edit course form;
- Since front-page course has a 'numsections' setting, format_site defines it as it's option;
- Removed accessing those fields in core code unless we know that format supports them and in this
case instead of $course = $DB->get_record('course'); we use:
$course = course_get_format($courseorid)->get_course(); This way all format-specific options
are added to the $course object
- Avoid using field course_sections.sequence for retrieving the modules list, use functionality from
get_fast_modinfo() instead;
- In the following functions/methods mark arguments $mod, $modnames, $modnamesused and $sections as
not used because they can be taken any time from get_fast_modinfo():
- function print_section()
- protected function format_section_renderer_base::section_summary()
- private function format_section_renderer_base::section_activity_summary
- public function format_section_renderer_base::print_single_section_page
- public function format_section_renderer_base::print_multiple_section_page
Initially, the default section title was swapped within the course format
javascript functions. Though some section titles may be custom and does not
require swapping, in addition they may have links to single section view. This
introduces some callback functions for define what needs to be done in
sections libs and js files.
The renderer isn't a public API yet, its just reducing code duplication
and tidying things up. So not making the methods public for other plugins
to abuse. We hope to solve this properly in 2.4
Topics and weeks have been converted to use a shared renderer to output
their content.
Note, I started with good intentions but this renderer has mixed
paradgims due to fast and cheap winning out on the trinity.
AMOS BEGIN
MOV [currenttopic,access],[currentsection,format_topics]
MOV [currentweek,access],[currentsection,format_weeks]
AMOS END
This is a course format independent url param and replaces weekly/topic specific params.
By using a standardised param we are able to use this url consistenly across the codebase
and reduce the risk of param collision
Using topics format as default is not a great idea, as we can end up
half-working dragdrop for some formats. With the current soiution, drag-drop
will not work for format, unless required js functions have been created in
format.js