The methods core_courseformat\base::set_section_number() and
core_courseformat\base:: get_section_number() have been deprecated
and replaced by core_courseformat\base::set_sectionnum() and
core_courseformat\base::get_sectionnum().
The new methods use the null value when all the sections must be
displayed (instead of 0). That way, section 0, can be displayed on
a single page too.
The page course/section.php has been created, to display the content of a
single section. This page will only accept sectionid (to get rid of the
legacy sectionnumber).
Some features of this page:
- The General section won't be displayed anymore above the selected
section.
- In the main course page content, regardless of the Course layout ("All
sections on one page" vs "One section per page"), all the section names
will link to the new page (except when editing mode is on).
Basically all them are comments.
Only remaining occurrence remaining is
in composer.lock file, because friends-of-behat/mink-extension
still has the old goutte as dev requirement, but that doesn't
affect us at all (no goutte is installed anymore, see the vendor
directory and/or the lock file).
Most section related actions require the frontend to use alternative
strings depending on the format plugin lang file. This patch adds
overridden strings to the current setViewFormat course editor setup
object.
The json_decode function does not accept a null, which is the
traditional default for get_user_preferences. By passing a default of
am empty string we avoid issues in PHP 8.1.
The highlight and unhighlight sections applies only to the format_topics
plugins. With this commit all the related code is migrated to reactive
component and format_topics extend the current course editor to add all
the logic
If you have one course format that extends another one, any course
format output classes that are not defined in the child format will
now inherit from the parent (instead of from the base class as
before).
Modified course format options reading and writing to be able to handle Editor elements by enabling them to split array values into
multiple values before inserting into database, and combining multiple values into an array when reading from the database.
Modified backup and restore code to use backup_nested_elements, and to interact directly with the database.
Co-authored-by: Jason den Dulk <jasondendulk@catalyst-au.net>
Co-authored-by: Matthew Hilton <matthewhilton@catalyst-au.net>
When updating/deleting a section/module, the system now only
invalidate of the element (section/module), not the whole course cache
Also, the system now only recalculate the cache for element (section/module)
if necessary, not the whole course cache
Move module/section purging to course_modinfo:
+ course_modinfo::purge_course_section_cache_by_id was created to purge section by id
+ course_modinfo::purge_course_section_cache_by_number was created to purge section by number
+ course_modinfo::purge_course_module_cache was created to purge module
For legacy reasons, the course renderings uses a format setting to know
if the page is multiple sections per page or a single section per page.
This format specific dependency is not solved using a get_course_display
format method any plugin can extend.
Now content and course index sections have special mutations to store
the collapsed preferences. This way the backend implementation is
independent of the frontend one and can use caches or other kind of
optimizations of necessary.
Move the section visible logic to the format base class. This way format
plugins can decide whenever a section is visible or not instead of using
format custom settings from core.
The course index is the first UI component that implements the new
drawers and the reactive components. The course index uses the course
state to present the current course structure and changes whenever
that structure change.