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

Refactor course index and course content preference names

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 4.0
    • 4.0
    • Course
    • Moppies Kanban

    Description

      In the current version, the course state uses the following variables to indicate the section collapsed/expanded values:

      • bool contentexpanded: indicate the section is expanded in the course content
      • bool isactive: indicate the section is expanded in the course index

      Those variables are used in the mustache files to decide if the section is expanded or collapsed.

      However, when a section is collapsed or expanded, the course preferences saved are:

      • bool contentcollapsed: if the section is collapsed in the content
      • bool indexcollapsed: if the section is collapsed in the course index

      This way of saving the preference is convenient because sections are expanded by default and the result JSON is smaller.

       

      The main problem is that the code for converting preferences to state can be confusing because they are antagonistic. Apart, "isactive" does not help to understand that affects only the course index (in the beginning only the course index was expandable). The code should be refactored to unify criteria:

      1. State and mustache files should work with "contentcollapsed" and "indexcollapsed" instead of "contentexpanded" and "isactive".
      2. Section preferences should not be modified as they are optimal this way and the names are clearer.

       

      Attachments

        Issue Links

          Activity

            People

              tusefomal Ferran Recio
              tusefomal Ferran Recio
              Carlos Escobedo Carlos Escobedo
              Shamim Rezaie Shamim Rezaie
              CiBoT CiBoT
              Amaia Anabitarte, Bas Brands, Carlos Escobedo, Laurent David, Raquel Ortega, Sabina Abellan, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                19/Apr/22

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 days, 5 hours, 3 minutes
                  2d 5h 3m