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

Incorporate section name into other parts of Moodle

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Course, Navigation, Usability
    • Labels:
      None
    • Database:
      Any
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      Moodle 2.0 provides a way to set the section name (e.g. Topic 1) to something more specific (e.g. Introduction to Calculus). Currently the section name is included in navigation, but not anywhere else in Moodle. Other places in Moodle refer to the section name as "Topic 1", "Week 1" or "Section 1" depending on the current course format.

      It would be nice if the rest of Moodle supported section names the way navigation does.

      The attached patches attempt to incorporate section name functionality into Moodle. I've split the changes into two patches.

      The first patch (get-section-name.patch):

      1. Modifies the get_section_name function in /course/lib.php to return the full name (e.g. Topic 1, Intro to Calculus, Week 4) instead of just the language string.
      2. Adds support for using navigation's callback_xxx_get_section_name callbacks in course formatters to control what section name is returned.
      3. Updates code references (as many as I could find) throughout Moodle to use the /course/lib.php get_section_name function.

      The second patch (use-sections.patch):

      1. Adds support for a new function, course_format_uses_sections, in /course/lib.php. This function returns true if the course format uses sections to display information (e.g. Topic format, Week format, but not SCORM format), Activity modules can use this function to determine how to display information.
      2. By default, course_format_uses_sections returns false. Course formats can implement a callback_xxx_uses_sections function in their lib.php file to indicate they use sections.
      3. Modifies several places, mainly index.php in activity modules, to use the new course_format_uses_sections function.

      In my opinion, students and teachers should benefit from consistently named sections throughout Moodle.

      These patches replace a lot of code that specifically looks for the topic or week course formats with more generic code. This should make writing additional course formats a little easier.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              samhemelryk Sam Hemelryk
              Reporter:
              blt04 Brandon Turner
              Tester:
              Nobody
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Barbara Ramiro, Bas Brands
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                24/Nov/10