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

Default gradedisplaytype from grade settings is not selected in locales diferent of English

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.9.10, 1.9.17, 2.2, 2.2.2, 2.4.3, 2.6.5, 2.7.2, 2.8
    • Fix Version/s: 2.6.6, 2.7.3
    • Component/s: Gradebook
    • Labels:
    • Environment:
      Indiferent. Locale diferent to English
    • Testing Instructions:
      Hide
      1. Install different Locales (Catalan, Finnish...)
      2. Create a course
      3. Enter to the course grade settings (In Catalan: Paràmetres de les qualificacions del curs) under /grade/edit/settings/index.php?id=COURSEID
      4. Change language (Try some)
      5. Default option must be selected in Grade display type field (in Catalan "Tipus de visualització de les qualificacions", default option must be "Per defecte (Real)")
      Show
      Install different Locales (Catalan, Finnish...) Create a course Enter to the course grade settings (In Catalan: Paràmetres de les qualificacions del curs) under /grade/edit/settings/index.php?id=COURSEID Change language (Try some) Default option must be selected in Grade display type field (in Catalan "Tipus de visualització de les qualificacions", default option must be "Per defecte (Real)")
    • Workaround:
      Hide

      The changes can be trivial or more sofisticated. In grade/edit/settings//form.php we can see:

      $options = array(-1 => get_string('default', 'grades'),
      GRADE_DISPLAY_TYPE_REAL => get_string('real', 'grades'),
      GRADE_DISPLAY_TYPE_PERCENTAGE => get_string('percentage', 'grades'),
      GRADE_DISPLAY_TYPE_LETTER => get_string('letter', 'grades'),
      GRADE_DISPLAY_TYPE_REAL_PERCENTAGE => get_string('realpercentage', 'grades'),
      GRADE_DISPLAY_TYPE_REAL_LETTER => get_string('realletter', 'grades'),
      GRADE_DISPLAY_TYPE_LETTER_REAL => get_string('letterreal', 'grades'),
      GRADE_DISPLAY_TYPE_LETTER_PERCENTAGE => get_string('letterpercentage', 'grades'),
      GRADE_DISPLAY_TYPE_PERCENTAGE_LETTER => get_string('percentageletter', 'grades'),
      GRADE_DISPLAY_TYPE_PERCENTAGE_REAL => get_string('percentagereal', 'grades'));
      asort($options);

      If we delete asort($options); the selector is not ordered but the behavior is the expected in all languages.

      Show
      The changes can be trivial or more sofisticated. In grade/edit/settings//form.php we can see: $options = array(-1 => get_string('default', 'grades'), GRADE_DISPLAY_TYPE_REAL => get_string('real', 'grades'), GRADE_DISPLAY_TYPE_PERCENTAGE => get_string('percentage', 'grades'), GRADE_DISPLAY_TYPE_LETTER => get_string('letter', 'grades'), GRADE_DISPLAY_TYPE_REAL_PERCENTAGE => get_string('realpercentage', 'grades'), GRADE_DISPLAY_TYPE_REAL_LETTER => get_string('realletter', 'grades'), GRADE_DISPLAY_TYPE_LETTER_REAL => get_string('letterreal', 'grades'), GRADE_DISPLAY_TYPE_LETTER_PERCENTAGE => get_string('letterpercentage', 'grades'), GRADE_DISPLAY_TYPE_PERCENTAGE_LETTER => get_string('percentageletter', 'grades'), GRADE_DISPLAY_TYPE_PERCENTAGE_REAL => get_string('percentagereal', 'grades')); asort($options); If we delete asort($options); the selector is not ordered but the behavior is the expected in all languages.
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_22_STABLE, MOODLE_24_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE
    • Pull Master Branch:
      MDL-26447_master

      Description

      In the settings of the gradebook you can choose the gradedisplay type. The sourcecode order this selector by name. In English the word Default is the first of the selector and produces the expected behavior. But in some other locales as mine (Catalan) the word used is "Per defecte" and produces that the selected item (if is not set in the database) is Letter (Lletra in Catalan) and this is not true.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  10/Nov/14