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

    Details

    • Database:
      MySQL
    • Testing Instructions:
      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).
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-27325_master

      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.

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  1/Aug/11