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

Absolute tolerance is not calculated correctly when grading numerical, calculated and calculatedsimple questions

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.2, 2.2.4, 2.3.1, 2.4
    • Fix Version/s: 2.2.5, 2.3.2
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide

      1.a Create a numerical question with tolerance 0, correct answer 0.

      1.b Check that 0 is graded right, and 1e-20 is graded wrong.

      2.a Create a numerical question with tolerance 1e-24, correct answer 0.

      2.b Check that 0 and 1e-24 are graded right and 1e-23 is graded wrong.

      3.a Create a numerical question with tolerance 0, correct answer 1e-20.

      3.b Check that 1e-20 and 1.0000000001e-20 are graded right, and 1.000001e-20 is graded wrong.

      4.a Create a numerical question with tolerance 1e-24, correct answer 1e-20.

      4.b Check that 1e-20 and 1.0001e-20 are graded right, and 1.0002e-20 is graded wrong.

      Show
      1.a Create a numerical question with tolerance 0, correct answer 0. 1.b Check that 0 is graded right, and 1e-20 is graded wrong. 2.a Create a numerical question with tolerance 1e-24, correct answer 0. 2.b Check that 0 and 1e-24 are graded right and 1e-23 is graded wrong. 3.a Create a numerical question with tolerance 0, correct answer 1e-20. 3.b Check that 1e-20 and 1.0000000001e-20 are graded right, and 1.000001e-20 is graded wrong. 4.a Create a numerical question with tolerance 1e-24, correct answer 1e-20. 4.b Check that 1e-20 and 1.0001e-20 are graded right, and 1.0002e-20 is graded wrong.
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      When the answer tolerance is set to absolute type the calculation to take in account the PHP precision is not correctly done for small values.
      ex answer = 8.33e-24 tolerance 0 actual range value calculated -9.999999991664E-15 to 1.0000000008336E-14
      There was a small mismatch when transfering the calculations from the numerical/questiontype.php to new engine numerical/question.php

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  10/Sep/12