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

Setting a maximum grade for a quiz doesn't work well with comma as a decimal separator (decsep).

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.3, 2.3
    • Fix Version/s: 2.1.7, 2.2.4, 2.3
    • Component/s: General, Quiz
    • Labels:
    • Testing Instructions:
      Hide

      1. With your language set to Croatian (or any other language that uses , for decsep)
      2. Go do Quiz settings -> Edit quiz (or whatever the translation is).
      3. Make sure you can set non-integer maximum grade (e.g. 65,5) , and maximum mark for each question.
      4. Make sure the value is saved as the non-integer value

      Show
      1. With your language set to Croatian (or any other language that uses , for decsep) 2. Go do Quiz settings -> Edit quiz (or whatever the translation is). 3. Make sure you can set non-integer maximum grade (e.g. 65,5) , and maximum mark for each question. 4. Make sure the value is saved as the non-integer value
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      If the user's language uses comma as a decimal separator, setting a maximum grade doesn't work well.

      Steps to reproduce:
      1. Set your language to a language that uses comma as decimal separator (decsep). (I'm using Hrvatski / Croatian)
      2. Create a quiz and open "Edit quiz" page. (Or do this step first, then change the language in a new tab, and refresh "Edit quiz" page. )
      3. Set maximum grade (najveća ocjena) to "65,5" (comma) and click "Save"/"Pohrani".
      4. Maximum grade is now 65 instead of 65,5.
      5. Set 65.5 (dot) as maximum grade and click "Save".
      6. Maximum grade is now 65,5 (notice the comma).
      7. Click "Save" without changing the grade.
      8. Maximum grade is now back to 65.

      This isn't a big issue in quiz editing, but maybe some other important part of Moodle is broken too. The problem seems to be within the function optional_param() which rounds the value because php's floatval() works only with dots.

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  25/Jun/12