Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-76888

Course hierarchy (Long-term solution)


    • Course hierarchy
    • Difficult
    • Large


      Indentation functionality was removed in Moodle 4.0 for reasons including: poor accessibility, poor mobile experience, and potential content formatting issues. Members of the community have expressed frustration with the removal of indentation functionality and is asking for it to be restored, citing that indentation is critical to organizing and structuring their courses.

      Based on the discovery phase outcomes, the key requirement identified was the need of having a proper course structure functionality that allows content creators to add subsections within sections and the ability to create nested content to build a better course hierarchy. 

      The technical discussion with the team highlighted the complexity of this solution and the impossibility of including this project to the 4.2 release, so the internal stakeholders agreed on proposing a short-term temporary solution to cover the users needs around this issue while working on the long-term solution.


      Initial discovery documentation

      Initial discovery interviews

      Co-design workshop


      Course hierarchy · Figma designs

      Course hierarchy · Prototypes


       Technical proposal

      After evaluating different options (link to the options summary document), the technical approach decided is:

      1. Incorporate single-section pages in all formats. From now on, section pages will be considered course subpages, which means they will have breadcrumb, won't display the fixed general section, and won't have the tertiary navigation tabs.
      2. Clean-up section methods to stop using section number as a section identifier. Most old methods will be replaced by new APIs using section id or sectioninfo to identify sections.
      3. Create a new section type called "delegated". Currently, sections can be regular or orphan, but the course format manages both. As the name suggests, in a "delegated" section, all section management, capabilities and display can be delegated to a plugin. By all means, the section will belong to a plugin and will use an integration class to control the section behaviour.
      4. Create a new activity called "mod_subsection" that uses delegate sections to present a section inside the activity card. This activity will resemble a "text and media" display but show the subsection content. This plugin will implement the delegate class to control the subsection and implement all the reactive course editor integration.
      5. Integrate delegate sections into the course index, course reports, backup/restore/import interfaces.

      Implementations phases

      Phase 1:

      • Introduce the course section page. The goal is to allow course format to present a single section as it is a part of the course, with all the navigation elements similar to an activity.
        • MDL-79986 improve the current course section page. This will adapt the visual elements to resemble the prototype and introduce section direct links.
          • MDL-80248 In the course/section.php, display the General section instead of displaying all the course sections
          • MDL-80249 In the course/section.php, hide secondary navigation and add breadcrumb
          • MDL-80250 Create a new section_viewed event to be triggered from the couse/section.php
          • MDL-80251 Create a behat step to go to a section
          • MDL-80418 Homogenize Adding / Updating activity titles, regardless the section where it belongs
        • MDL-79987: improve the course layout in one section per page visualization
      • Clean-up the current section methods to prepare the implementation of delegate sections in next phases. Those issues include stop using section numbers to identify sections and replace old methods by new ones using section ids or sectioninfo objects.
        • MDL-77038 deprecate stateactions:section_move method. The course editor should only use section_move_after.
        • MDL-79999: Refactor course_modinfo so sections are indexed primarily by Id, and secondary by number. Currently it is the other way around and it is impossible to store sections with the same section number value (including null).
        • MDL-80000:  decide the place for the new section and activities API. The clean-up issue will deprecate many global functions from course/lib.php. This file uses a very old structure, and all new methods should be replaced by classes. This task will determine the location of those new APIs. Once done, the new API classes must be created.
        • MDL-80001: find all the places were section number is misused as a valid section id. Once done, all methods with this problem should be replaced or refactored.
          • (this will be more than one issue) Create section id (or sectioninfo) alternatives to the methods identified in the previous task. The new methods should be part of the new section or activity APIs determined in Task01. Also, deprecate the previous methods.
        • MDL-80048: a task to create a mod_subsection plugin skeleton. This stub plugin will be used in the testing instructions in Phase 2 and will be the base of the final mod_subsection in Phase 3.

      Phase 2:

      • Implement delegated sections. Some new delegate fields will be added to the section table in this phase. Those fields will be cached in course_modinfo. This phase will only introduce integrations to decide if the section is rendered in the course or not. Future phases will add more integrations. To integrate the issues, most testing instructions will provide adhocs "text and media" modifications so it can be used as a delegate plugin.
        • MDL-80186: add delegate section fields to the course_section table and make course_modinfo cache them. The field will be null by default and have the name of the delegated plugin when delegated. The delegate ID will be a number the delegate plugin must set to identify the instance. This will introduce new sectioninfo methods like  is_delegated, get_delegate and get_delegateid.
          • MDL-80187: implement course section API methods to create and destroy delegated sections from a plugin.
          • MDL-80190: Create the first delegated section integrations to hide a section on the course page. This issue will create the core_course\section_delegate abstract class that plugins must extend to control their delegated sections.
            • MDL-80715: syn delegated sections names with the delegate plugin
          • MDL-80553: fix delegate sections PHPUnit tests.
          • MDL-80799: fix create section zero but with the new section actions API.
          • MDL-80191: improve the activity restore steps so a plugin with delegated sections can set the delegate ID value during the restore process. Sections are restored before the activity plugins; this means the section restoration process cannot update the delegate ID and the delegate plugin should do it manually.
            • MDL-80194: TASK: evaluate what happens to the course recycle bin when an activity from a delegated section is deleted and restored later on.
          • MDL-80203: allow delegate plugins to override the section dropdown actions.
          • ¿?: disable extra format actions in delegate sections. Delegate sections do not belong to the format and, for now, they won't be able to add extra actions to the menus. There may be a way in the future, but specific format actions like highlighting won't be available for now.
        • MDL-80193: TASK: decide the privacy of mod_subsection and implement all the necessary class
      • Update section and activity cards to match the prototype
        • MDL-80219: Remove borders from activity cards and add borders to sections.
        • MDL-80220: match visibility badges
        • MDL-80620: Match chevrons styling
        • MDL-80621: Match separators and "+" buttons
        • MDL-80622: Improve the shadow element when dragging activity cards
      • Sections and subsections will be created as "New section", and renumerations won't be automatic anymore
        • MDL-80460: Create sections with "New section"
        • MDL-80461: Eliminate unnecessary references to topics/weeks in the UI.
        • MDL-80541: Homogenize the section form title
        • MDL-80542: Replace Show/Hide in the section menu with the Availability component
      • Others:
        • MDL-80557: Change the default order for the course formats
        • MDL-80756: Deprecate get_view_url() function

      Phase 3:

      • Create the first version of the mod_subsection activity. This new activity will be disabled by default with a text explaining that is an experimental feature.
        • ¿?: Create the mod_subsection activity. The activity will only display a link to the section page and can be created as any other activity. The main difference is that it will use a delegated section that won't be listed as a normal section on the course page. The activity must create the delegated section when an instance is created and destroy it when it is destroyed (including all delegated section activities).
        • ¿?: create delegate section integrations to control if a section or an activity is visible/available from mod_subsection. The main logic will be described in the issue description, but the general is clear. After the core calculates the section availability, it passes the expected result to the delegate plugin to add more logic if necessary.
        • ¿?: allow mod_subsection to override the activity actions dropdown (and probably replace it with a section actions dropdown). This issue may disappear if the UX team describe what happens with delegated sections depending on the current activity settings (for example, the visible stealth value).
        • ¿?: prevent the creation of mod_subpage instances inside a delegated section. This will be a new activity feature the course format, and the mod chooser will check to decide if a new instance can be added to a specific section.
        • ¿?: create a behat "mod_subsection > activities" step to generate activities inside a subsection.
        • MDL-80714 (task): evaluate n alternative preferences storing for subsection.
      • Improve the add activities and section buttons to match the prototype:
        • ¿?: Modify the add activity and section buttons to resemble the project prototype. This also includes the add new activity between activities buttons. For now, the changes are styling, but they will help implement the next phase.
        • ¿?: Remove the activity card border and add borders to the sections. According to the prototype, sections have rounded borders, while activities only display a bottom line to separate elements. This issue may include other minor UI tweaks to adapt to the prototype.

      Phase 4:

      • Integrate mod_subsection into the course content so they are displayed more like a section.
        • ¿?: Add methods in the mod_subsection library to display the section content as collapsible inside the activity card. This issue will include integrating the reactive course editor so activities can be dragged inside/outside a subsection.
        • ¿?: Add buttons to create mod_subsection instances with one click directly from the course page, like the prototype. Once this is done, this issue will also hide the mod_subsection from the activity chooser. This issue will include adding a new feature to mod plugins so they can be created with default values.
        • ¿?: add the "expand / collapse all sections" on the section page. This was not necessary until subsections appeared.
      • Integrate delegate sections (now only from mod_subsection) into the course index.
        • ¿?: Add a section delegate integration the course index can use to present an activity as a subsection. The idea is that the full node will be collapsible with all inner contents below. This will include the course editor integrations to allow dragging activities in and out of the subsection.
      • Integrate delegated sections into the general navigation
        • ¿?: allow the delegate plugin (mod_subsection) to add new breadcrumb nodes when presenting content from a delegated section. This includes the section page but also any inner activity page.
        • ¿?: make delegated sections visible from the navigation block in the classic theme.
      • Deprecate all redundant course/lib.php methods
        • MDL-80482: During the project many course/lib.php functions will be replaced by the new libraries proposed in MDL-80000. In this issue all those methods will be deprecated.

      Phase 5:

      • Adapt existing UIs to display delegated sections below the delegate activity (mod_subsection)
        • ¿?: allow delegated sections in course reports.
        • ¿?: incorporate delegate sections to backup/restore/import forms.
      • Implement any necessary webservice required to display mod_subsection in the mobile APP.
        • Task: identify all the requirements to integrate mod_subsection and delegated sections in the Moodle Mobile APP.
          • ¿?: adapt the current webservices so the mobile APP knows when a section is delegated.
          • ¿?: incorporate webservices to mod_subsection so the mobile APP can render the content.
          • ¿?: incorporate mobile templates in mod_subsection.
      • Implement all changes to adapt the course content download to subsections.
        • ¿?: Incorporate activity contents to the mod_subsection download content.
      • Adapt activity chooser to delegate sections without section number
        • MDL-80295: Modify the activity chooser to use section ID instead of section number
      • Adapt drag and drop files into course page to work with delegate sections
        • MDL-80296: Modify the course file drop to use sectionID instead of section number
      • Others:
        • MDL-80556: Simplify the blocks by removing Section links 
        • MDL-79918: Simplify the course settings by removing the setting Hidden sections
        • MDL-79916: Simplify the course format options by removing Social format


        Issue Links



              30 Vote for this issue
              60 Start watching this issue




                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.