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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.2, 2.2.4, 2.3.1, 2.4
    • 2.2.5, 2.3.2
    • Questions
    • MOODLE_20_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • MOODLE_22_STABLE, MOODLE_23_STABLE
    • 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.

    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

      Attachments

        Activity

          People

            timhunt Tim Hunt
            ppichet Pierre Pichet
            Aparup Banerjee Aparup Banerjee
            Rajesh Taneja Rajesh Taneja
            Safat Shahin, Tim Hunt, Amaia Anabitarte, Bas Brands, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Kevin Percy, Laurent David, Mathew May, Mihail Geshoski, Raquel Ortega, Sabina Abellan, Sander Bangma, Sara Arjona (@sarjona), Shamim Rezaie
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              10/Sep/12