Hello,
I've released an updated 'release candidate' version of the Collapsed Topics course format for Moodle 4.5 as follows:
Release 405.0.2 for Moodle 4.5 version 2024100700.00 (Build: 20241007) and above within the MOODLE_405_STABLE branch until the next release:
- https://moodle.org/plugins/format_topcoll/405.0.2/35234
- https://github.com/gjbarnard/moodle-format_topcoll/releases/tag/V405.0.2
with:
- Fix 'Student view not working as expected within hidden sections' - #153.
- Fix 'Hidden from Students not showing in section header' - #154. Note: Does not update via AJAX yet!
- Fix the Course Index to always link to the main course page as being dynamic is not possible due to caching. This is contrary to core where the links are to the single section page, which the format already implements next to the section.
- Refactored toggle JS to convert from YUI to ES6.
- One section applies even when editing.
- Old toggle format was ages ago, so no longer checking.
- Sub section support.
- 'numsections' has been removed in order to feasibly support Sub sections.
Important:
This is still a 'release candidate' because of 'Sub section support' which has been incredibly difficult to support to the extent that I've had to wave a 'white flag' and remove the 'numsections' setting. The course format API has been broken apart into so many interconnected small pieces (each tending to have separate PHP, JS and Mustache files), https://moodledev.io/docs/4.5/apis/plugintypes/format#format-output-classes-and-templates and https://moodledev.io/docs/4.5/apis/plugintypes/format#the-course-editor-structure, that it is difficult at times to understand and keep in working memory what is going on and where a given element of functionality is implemented to the extent where it can be overridden and changed. Thus the format will now operate as 'Topics' does in terms of number of sections management. Collapsed Topics was only ever designed to operate on sections and as such sees 'Sub sections' as different entities not related to the number of sections in a course. This has an impact on the core 'maxsections' setting and when its restriction comes into play. Collapsed Topics will allow you to have as many 'Sub sections' as you want as long as they're added before the number of 'Sections' is less than the maximum number of sections. Tracker issues of interest for this are: MDL-84038 and MDL-84291.
Because of the removal of 'numsections', this has an impact on backup and restore, which I've tested. However with such a change brings risk and a greater chance of error, thus I cannot stress enough that you MUST test and be sure that the format works as expected before it goes anywhere near a production server. I found with the Grid format that once 'numsections' was removed that it was tricky to go back, and therefore it would be unlikely even with the flexibility I like of being able to set the number of sections both as a course setting and add / remove in the course itself.
I have refactored the whole toggle state preference JavaScript such that it no longer uses YUI. This I hope will help to keep the format going for many years to come as older technologies are removed from core.
Note: Always install on a test server to confirm that the format does what you want it to do before updating or installing on a production server! And as this release could contain bugs and so I strongly recommend that you check on a test server first! Not sure how to set one up? Then look at the 'Installer packages' on https://download.moodle.org/releases/latest/. Ensure that you have multiple backups of all data before using. Please report any issues. i.e. 'bugs' with this release ONLY here. Before doing so please read 'Reporting issues' on the 'Information' tab on the course format 'Settings' under 'Site administration' -> 'Plugins' -> 'Course formats' -> 'Collapsed Topics'.
If you find this post useful, then please mark it so.
Thank you,
Gareth