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

Default grade display type displayed incorrectly depending on interface language

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.6.5
    • Fix Version/s: None
    • Component/s: Gradebook
    • Labels:
      None
    • Affected Branches:
      MOODLE_26_STABLE

      Description

      Inside a course, go to Grade administration > Course grade settings (In grade/edit/settings/index.php?id=xxx) and change the value for "Grade display type".

      For example we select "Real" for "Grade display type", the displaytype options look like this:

      <option value="-1">Default (Real)</option>
      <option value="3">Letter</option>
      <option value="32">Letter (percentage)</option>
      <option value="31">Letter (real)</option>
      <option value="2">Percentage</option>
      <option value="23">Percentage (letter)</option>
      <option value="21">Percentage (real)</option>
      <option value="1" selected="selected">Real</option>
      <option value="13">Real (letter)</option>
      <option value="12">Real (percentage)</option>
      

      In the database there is now a row for displaytype with value 1 in mdl_grade_settings:

       id  | courseid |           name            | value 
      -----+----------+---------------------------+-------
       973 |    14311 | displaytype               | 1
      

      This is the way one would expect this to work for all values. In the list there is selected="selected" on value="1" and we have a row for the displaytype setting in the database.

      When selecting "Default (Real)", things behave differently.

      <option value="-1">Default (Real)</option>
      <option value="3">Letter</option>
      <option value="32">Letter (percentage)</option>
      <option value="31">Letter (real)</option>
      <option value="2">Percentage</option>
      <option value="23">Percentage (letter)</option>
      <option value="21">Percentage (real)</option>
      <option value="1">Real</option>
      <option value="13">Real (letter)</option>
      <option value="12">Real (percentage)</option>
      

      There is no option selected and no row for displaytype in mdl_grade_settings.

      For english language the bug is not noticeable. The "Grade display type" dropdown sorts items alphabetically.
      "Default (Real)" is the first item in the alphabetical list, so it is selected by default when there's no value for displaytype in the database.

      For other languages, the order of items can be different. For example in Finnish the list looks like this.

      <option value="3">Kirjain</option>
      <option value="32">Kirjain (prosentti)</option>
      <option value="31">Kirjain (todellinen)</option>
      <option value="-1">Oletus (Todellinen)</option>
      <option value="2">Prosenttia</option>
      <option value="23">Prosenttia (kirjain)</option>
      <option value="21">Prosenttia (todellinen)</option>
      <option value="1">Todellinen</option>
      <option value="13">Todellinen (kirjain)</option>
      <option value="12">Todellinen (prosenttia)</option>
      

      In this case "Kirjain" would be selected and mistakenly saved when the user clicks on "Save changes".

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                schach Heiko Schach
                Participants:
                Component watchers:
                Jake Dallimore, Jun Pataleta
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: