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

Small floats changed to 0 when stored in TEXT cols in the DB - this breaks numerical questions

    XMLWordPrintable

Details

    • MySQL
    • MOODLE_20_STABLE
    • MOODLE_20_STABLE
    • MDL-27325_master
    • Hide

      To test:

      • Create a new numerical question. Text doesn't matter. Set the answer, for instance, to 1E-6, and accepted error to 5E-7, 100% grade.
      • Save the question.
      • TEST: Re-edit it: the answer should be shown as originally set (1E-6) or some numerically equivalent expression.
      • TEST: Run the DB unit tests (Admin->Development->Functional DB tests) against all the DB drivers (mysqli, pgsql, mssql, sqlsrv and oci). No failures/exception should happen in the test_insert_record, test_update_record and test_set_field unit tests.

      Note: At the time of writing these instructions all the DB drivers but the sqlsrv one have been already tested. Also it would be interesting to run it in one 32bits LAMP stack (I've 64bits here only).

      Show
      To test: Create a new numerical question. Text doesn't matter. Set the answer, for instance, to 1E-6, and accepted error to 5E-7, 100% grade. Save the question. TEST: Re-edit it: the answer should be shown as originally set (1E-6) or some numerically equivalent expression. TEST: Run the DB unit tests (Admin->Development->Functional DB tests) against all the DB drivers (mysqli, pgsql, mssql, sqlsrv and oci). No failures/exception should happen in the test_insert_record, test_update_record and test_set_field unit tests. Note: At the time of writing these instructions all the DB drivers but the sqlsrv one have been already tested. Also it would be interesting to run it in one 32bits LAMP stack (I've 64bits here only).

    Description

      Certain number formats aren't parsed correctly by moodle code, and thus aren't saved correctly. For instance, 5.05 as answer doesn't have problems, but 5E-6 does. Also 0.0000005 doesn't work well.

      Attachments

        Activity

          People

            stronk7 Eloy Lafuente (stronk7)
            orestes Orestes Mas
            Sam Hemelryk Sam Hemelryk
            Glenn Ansley Glenn Ansley
            Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Safat Shahin, Tim Hunt, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              1/Aug/11