Moodle
  1. Moodle
  2. MDL-33498

Inconsistent management of decimal grades in mod Assign

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.3
    • Component/s: Assignment
    • Labels:
      None
    • Testing Instructions:
      Hide
      1. Add the "Espanol international" language pack to Moodle (Site administration -> Language -> Language packs)
      2. Enable the "Display language menu" setting (Site administration -> Language -> Language settings)
      3. Create an instance of mod_assign in a course with at least one student in it
      4. Go to the site home page and change the language to "Espanol international"
      5. Go to the new assignment and click "Ver/Calificar todas las entregas" (View/grade all submissions)
      6. From the grading screen, grade one of the students and give them a decimal grade (e.g. 12.4)
      7. From the grading screen the new grade should display as "12,4"
      8. Edit the grade and it should be editable as "12,4"
      9. Save the grade and it should display as "12,4" and not be rounded to 12.
      Show
      Add the "Espanol international" language pack to Moodle (Site administration -> Language -> Language packs) Enable the "Display language menu" setting (Site administration -> Language -> Language settings) Create an instance of mod_assign in a course with at least one student in it Go to the site home page and change the language to "Espanol international" Go to the new assignment and click "Ver/Calificar todas las entregas" (View/grade all submissions) From the grading screen, grade one of the students and give them a decimal grade (e.g. 12.4) From the grading screen the new grade should display as "12,4" Edit the grade and it should be editable as "12,4" Save the grade and it should display as "12,4" and not be rounded to 12.
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull Master Branch:
    • Rank:
      41401

      Description

      New mod Assign can store grades internally as decimal numbers (10.5).

      In non-english locales (European, South America, South Africa) the decimal separator is a comma. Moodle correctly translates the grades form stored format (for instance 8.50) to display format (8,50) in the grading forms, and that becomes a problem.

      One stored, a number like 8.50 is presented in the grading form like 8,5 and that value does NOT validate by is_numeric in gradeform.php validation. Cannot be saved.

      So, even if teacher are instructed to use a "." as decimal separator, every time you review an assessment you need to manually change ',' for '.', even in previously well stored grades. A major inconvenience.

      This problem is solved by gradebook scripts. There, when entering an offset or multiplier for a gradeitem in a form you can user either "5.0" or "5,0" in both formats the number is correctly recognized and stored in decimal fields in database.

        Issue Links

          Activity

          Hide
          Damyon Wiese added a comment -

          Thanks, Enrique - interesting bug. I'll take a look.

          Show
          Damyon Wiese added a comment - Thanks, Enrique - interesting bug. I'll take a look.
          Hide
          Damyon Wiese added a comment -

          Just noticed this was conflicting with integration (was based off master). I have rebased onto integration and resolved the conflict.

          Show
          Damyon Wiese added a comment - Just noticed this was conflicting with integration (was based off master). I have rebased onto integration and resolved the conflict.
          Hide
          Sam Hemelryk added a comment -

          Hi Damyon,

          Changes look good and I've put this up for integration now.
          I was reading about this sort of issue this morning, glad to see you are already on to it!

          Cheers
          Sam

          Show
          Sam Hemelryk added a comment - Hi Damyon, Changes look good and I've put this up for integration now. I was reading about this sort of issue this morning, glad to see you are already on to it! Cheers Sam
          Hide
          Dan Poltawski added a comment -

          Integrated, thanks

          Show
          Dan Poltawski added a comment - Integrated, thanks
          Hide
          Dan Poltawski added a comment -

          Tested and passed. Thanks.

          Show
          Dan Poltawski added a comment - Tested and passed. Thanks.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          We could celebrate it today... but better if we perform a bigger party after releasing Moodle 2.3.

          Print this message and come to Perth that day, it's valid for one beer, wine, coke or... water, as you wish.

          Many thanks for your collaboration!

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - We could celebrate it today... but better if we perform a bigger party after releasing Moodle 2.3. Print this message and come to Perth that day, it's valid for one beer, wine, coke or... water, as you wish. Many thanks for your collaboration! Ciao

            People

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

              Dates

              • Created:
                Updated:
                Resolved: