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

CMILongIdentifier and CMIIdentifier are not checked for valid URI (RFC 3986 [6]) and URN syntax

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.2.2
    • 2.2.1, 2.3
    • SCORM
    • MOODLE_22_STABLE, MOODLE_23_STABLE
    • MOODLE_22_STABLE
    • master_MDL-30578
    • Hide

      It can be tested by running the SCORM Test Harness for DMI package - Data Model Implementation Test 1.
      1. Download the DMI Test package.
      2. Run the SCORM Test Harness for DMI as specified here - SCORM Test Harness
      3. Check the Log for the the errors listed in the description.

      NOTE: Many other errors are reported by this test - this patch only addresses the issues mentioned.

      Show
      It can be tested by running the SCORM Test Harness for DMI package - Data Model Implementation Test 1. 1. Download the DMI Test package . 2. Run the SCORM Test Harness for DMI as specified here - SCORM Test Harness 3. Check the Log for the the errors listed in the description. NOTE: Many other errors are reported by this test - this patch only addresses the issues mentioned.

      We need to fix the regex expression for CMIIdentifier and CMILongIdentifier.
      The current allows - empty string - "" as a valid identifier and does not return a 406 erorr - which should not be the case, causing the following errors in Activity 1 DMI -

      ERROR: Evaluating SetValue("cmi.objectives.1.id", "") - Expected: "false" - LMS Returned: "true"
      ERROR: Evaluating GetLastError("") - Expected: "406" - LMS Returned: "0"
      Evaluating GetValue("cmi.objectives.1.id") - Expected: "" - LMS Returned: ""
      ERROR: Evaluating GetLastError("") - Expected: "301" - LMS Returned: "0"
      ERROR: Evaluating SetValue("cmi.objectives.1.id", "MYID01") - Expected: "true" - LMS Returned: "false"
      ERROR: Evaluating GetLastError("") - Expected: "0" - LMS Returned: "351"
      ERROR: Evaluating GetValue("cmi.objectives.1.id") - Expected: "MYID01" - LMS Returned: ""
      Evaluating GetLastError("") - Expected: "0" - LMS Returned: "0"
      ERROR: Evaluating SetValue("cmi.objectives.2.id", "MYID01") - Expected: "false" - LMS Returned: "true"
      ERROR: Evaluating GetLastError("") - Expected: "351" - LMS Returned: "0"
      ERROR: Evaluating GetValue("cmi.objectives.2.id") - Expected: "" - LMS Returned: "MYID01"
      ERROR: Evaluating GetLastError("") - Expected: "301" - LMS Returned: "0"
      ERROR: Evaluating GetValue("cmi.objectives.2.id") - Expected: "" - LMS Returned: "MYID01"
      ERROR: Evaluating GetLastError("") - Expected: "301" - LMS Returned: "0"

      We need to check for the string value when creating cmi.< >.n.id as per the format for a valid URI (RFC 3986 [6]) and URN syntax as per RFC 2141 [3] and return a 406 error code if the value is not in the proper format.
      It says in particular -
      1. The string should not contain all white spaces (and should not be an empty string).
      2. If the string starts with "urn:" it should have the full format like - "urn:something:SomethingOrSomethingElse"
      3. If it does not contain "urn:" at the start of string, then the string can contain any printable characters without any whitespace.

            danmarsden Dan Marsden
            mayank_gupta2005 Mayank Gupta
            Dan Marsden Dan Marsden
            Aparup Banerjee Aparup Banerjee
            Adrian Greeve Adrian Greeve
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.