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

Perform natural sort on groups and groupings

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Won't Do
    • 1.9.9, 2.0, 3.0.8, 3.2.3
    • None
    • Groups
    • MOODLE_19_STABLE, MOODLE_20_STABLE, MOODLE_30_STABLE, MOODLE_32_STABLE

    Description

      Groups and groupings are currently sorted using a basic alphanumeric sort (as the sorting is done by the DBMS), which fails to sort names with numbers in them correctly when the number of digits differs. For example, if you use the auto-create groups feature to create 20 groups using the naming scheme "Group #" it'll create "Group 1" through "Group 20" - but they'll appear in lists in the order "Group 1, Group 10, Group 11, ..., Group 19, Group 2, Group 20, Group 3, ..." which isn't ideal.

      I've attached patches against Moodle 1.9.9 and Moodle 2.0 (cvshead from git.moodle.org/moodle.git) which implement natural sorting on groups and groupings. I may have missed any places that they're listed outside the groups/groupings admin area, as I haven't done an exhaustive search of Moodle for lists of groups/groupings).

      Note that you won't be able to get to the Groupings or Overview tabs on 2.0 until MDL-22903 is resolved (unless you manually patch it), and that the list of groups assigned to the selected member in the group assignment list will not appear on 2.0 until MDL-22935 is resolved. These features will all still be sorted correctly by the attached patch.

      Attachments

        Issue Links

          Activity

            People

              moodle.com Moodle HQ
              paul.n Paul Nicholls
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              14 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: