Moodle
  1. Moodle
  2. MDL-7068 META: SCORM 2004 compliance + issues
  3. MDL-28707

minnormalizedmeasure can be a negative floating-point value. Alter database table scorm_seq_objective structure

    Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 2.1
    • Fix Version/s: DEV backlog
    • Component/s: SCORM
    • Database:
      Any
    • Testing Instructions:
      Hide

      To reproduce this issue follow the steps -
      1. Download the ADL SCORM Test package DMB. You can download them from here - https://github.com/mayankgupta/moodle_scorm_test_harness/tree/master/ADL2004/LMSTestCourseZipPackages
      2. Add the SCORM package as activity inside a course.
      3. Fill in the instructions and save.
      4. You will come across the error - "Error writing to database"
      5. If you have debugging turned on you would get the following debug info

      Debug info: Out of range value for column 'minnormalizedmeasure' at row 1
      INSERT INTO mdl_scorm_seq_objective (scoid,primaryobj,objectiveid,minnormalizedmeasure) VALUES(?,?,?,?)
      [array (
      0 => 17,
      1 => 1,
      2 => 'SEQSUCCESSSTATUSOVERRIDE01',
      3 => '-0.5',
      )]
      Stack trace:

      line 397 of \lib\dml\moodle_database.php: dml_write_exception thrown
      line 878 of \lib\dml\mysqli_native_moodle_database.php: call to moodle_database->query_end()
      line 920 of \lib\dml\mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
      line 590 of \mod\scorm\datamodels\scormlib.php: call to mysqli_native_moodle_database->insert_record()
      line 238 of \mod\scorm\locallib.php: call to scorm_parse_scorm()
      line 120 of \mod\scorm\lib.php: call to scorm_parse()
      line 410 of \course\modedit.php: call to scorm_add_instance()

      Show
      To reproduce this issue follow the steps - 1. Download the ADL SCORM Test package DMB. You can download them from here - https://github.com/mayankgupta/moodle_scorm_test_harness/tree/master/ADL2004/LMSTestCourseZipPackages 2. Add the SCORM package as activity inside a course. 3. Fill in the instructions and save. 4. You will come across the error - "Error writing to database" 5. If you have debugging turned on you would get the following debug info Debug info: Out of range value for column 'minnormalizedmeasure' at row 1 INSERT INTO mdl_scorm_seq_objective (scoid,primaryobj,objectiveid,minnormalizedmeasure) VALUES(?,?,?,?) [array ( 0 => 17, 1 => 1, 2 => 'SEQSUCCESSSTATUSOVERRIDE01', 3 => '-0.5', )] Stack trace: line 397 of \lib\dml\moodle_database.php: dml_write_exception thrown line 878 of \lib\dml\mysqli_native_moodle_database.php: call to moodle_database->query_end() line 920 of \lib\dml\mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw() line 590 of \mod\scorm\datamodels\scormlib.php: call to mysqli_native_moodle_database->insert_record() line 238 of \mod\scorm\locallib.php: call to scorm_parse_scorm() line 120 of \mod\scorm\lib.php: call to scorm_parse() line 410 of \course\modedit.php: call to scorm_add_instance()
    • Affected Branches:
      MOODLE_21_STABLE
    • Pull Master Branch:
      master_MDL-28707
    • Rank (Obsolete):
      1423

      Description

      In SCORM 2004 Packages minNormalizedMeasure can be a negative floating point number and is not always a positive value.
      ADL SCORM 2004 Test package DMB has minNormalizedMeasure value -0.5 in the imsmanifest.xml file. The minnormalizedmeasure field in scorm_seq_objective table has attribute - UNSIGNED, due to which while adding minnormalizedmeasure value to the scorm_seq_objective table a dml_write_exception is thrown.
      The imsmanifest.xml file for test package DMB can be found here - imsmanifest.xml

        Activity

        Hide
        Dan Marsden added a comment -

        Thanks Mayank

        Show
        Dan Marsden added a comment - Thanks Mayank
        Hide
        Dan Marsden added a comment -

        NOTE TO INTEGRATOR: only master branch for 2 reasons.

        1. Db schema change
        2. SCORM 2004 isn't supported in stable branches - probably won't be "officially supported" in master either, but at least we're improving the 2004 stuff - thanks for listening....

        Show
        Dan Marsden added a comment - NOTE TO INTEGRATOR: only master branch for 2 reasons. 1. Db schema change 2. SCORM 2004 isn't supported in stable branches - probably won't be "officially supported" in master either, but at least we're improving the 2004 stuff - thanks for listening....
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Hi guys,

        I'm rejecting this:

        • Please use the XMLDB Editor instead of manual editing. Signed is one attribute only supported in integers, not sure how that ended there.
        • I would recommend to stop using floats and use decimal/number instead. Globally. floats are supported but deprecated.
        • Testing instructions, that only happens under MySQL correct?

        Ciao

        Show
        Eloy Lafuente (stronk7) added a comment - Hi guys, I'm rejecting this: Please use the XMLDB Editor instead of manual editing. Signed is one attribute only supported in integers, not sure how that ended there. I would recommend to stop using floats and use decimal/number instead. Globally. floats are supported but deprecated. Testing instructions, that only happens under MySQL correct? Ciao
        Hide
        Dan Marsden added a comment -

        why isn't signed supported in floats? - it seems to be fine for mysql and postgres?

        using decimal will be a pain as the data isn't stored in the same way and we'd need to change code as well - which I suppose we will have to if float isn't allowed.

        Show
        Dan Marsden added a comment - why isn't signed supported in floats? - it seems to be fine for mysql and postgres? using decimal will be a pain as the data isn't stored in the same way and we'd need to change code as well - which I suppose we will have to if float isn't allowed.
        Hide
        Dan Marsden added a comment -

        I am no longer spending time as a volunteer working on SCORM 2004 issues - I will continue to support SCORM 1.2/AICC and the future work on Tin Can but all issues directly related to SCORM 2004 are now being closed as won't fix.

        For more information on the reasons SCORM 2004 is no longer being supported please see:
        https://moodle.org/mod/forum/discuss.php?d=227906

        This issue can be re-opened under the following conditions:

        • A patch is provided by someone in the community that fixes this issue.
        • The patch meets Moodle's coding guidelines.
        • full testing instructions are provided that allows the issue to be tested correctly.
        • Unit tests (where possible) have been implemented.
        • The patch can be attributed directly to a SCORM 2004 ADL test that now passes with the patch (if the patch is related to running the SCORM package)
        • Screenshots of the SCORM 2004 ADL test being completed with the patch.

        If funding is provided to pay for the time of the SCORM maintainer to review/test/develop some of the above are not fixed requirements.

        If you can satisfy the above requirements please add the details to this bug and we can look at re-opening this issue.

        Show
        Dan Marsden added a comment - I am no longer spending time as a volunteer working on SCORM 2004 issues - I will continue to support SCORM 1.2/AICC and the future work on Tin Can but all issues directly related to SCORM 2004 are now being closed as won't fix. For more information on the reasons SCORM 2004 is no longer being supported please see: https://moodle.org/mod/forum/discuss.php?d=227906 This issue can be re-opened under the following conditions: A patch is provided by someone in the community that fixes this issue. The patch meets Moodle's coding guidelines. full testing instructions are provided that allows the issue to be tested correctly. Unit tests (where possible) have been implemented. The patch can be attributed directly to a SCORM 2004 ADL test that now passes with the patch (if the patch is related to running the SCORM package) Screenshots of the SCORM 2004 ADL test being completed with the patch. If funding is provided to pay for the time of the SCORM maintainer to review/test/develop some of the above are not fixed requirements. If you can satisfy the above requirements please add the details to this bug and we can look at re-opening this issue.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: