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.
- added function format_base::is_section_current()
- overwritten in format_weeks::is_section_current()
- deprecated function format_section_renderer_base::is_section_current()
- 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.
* Introduce function format_weeks_get_section_dates which is used
as the consistent place to calculate the current section start and
end date
* Rework callback_weeks_get_section_name to not use the above function
rather than do crazy needless looping through all sections to work
out the current week title.
* Change the just introduced is_current renderer function to share
the format_weeks_get_section_dates function to ensure both the title
and 'current week' are using the same dates to do their job
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
It allows to define M.course.format.swap_sections and
M.course.format.get_section_selector in the course format javascript file, so
that course dragdrop is aware about perculiar layout and changes that need to
be done when sections are swapped.