Uploaded image for project: '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
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 2.1
    • Fix Version/s: None
    • 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

      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

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: