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

SCORM interactions and objectives not commiting properly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Critical Critical
    • None
    • 1.9.10, 2.0, 2.1
    • SCORM
    • None
    • Any
    • MOODLE_19_STABLE, MOODLE_20_STABLE, MOODLE_21_STABLE
    • Hide

      To solve the problem, one can remove the two lines of code that erroneously keep track of the last values set for any element (see patch) which reverts to the old behaviour of always sending all the data each time LMSCommit() is called.

      Show
      To solve the problem, one can remove the two lines of code that erroneously keep track of the last values set for any element (see patch) which reverts to the old behaviour of always sending all the data each time LMSCommit() is called.
    • Easy
    • Hide

      Use a SCORM debugging package to runn the following:

      LMSInitialize("", "")
      LMSSetValue("cmi.interactions_0.id", "SC_0200_a")
      LMSSetValue("cmi.interactions_0.result", "wrong")
      LMSSetValue("cmi.interactions_1.id", "SC_0210_a")
      LMSSetValue("cmi.interactions_1.result", "wrong")
      Commit("", "")

      The "id" and "result" sub-elements will be written for interaction 0, but only the "id" sub-element will be written for interaction 1.

      Show
      Use a SCORM debugging package to runn the following: LMSInitialize("", "") LMSSetValue("cmi.interactions_0.id", "SC_0200_a") LMSSetValue("cmi.interactions_0.result", "wrong") LMSSetValue("cmi.interactions_1.id", "SC_0210_a") LMSSetValue("cmi.interactions_1.result", "wrong") Commit("", "") The "id" and "result" sub-elements will be written for interaction 0, but only the "id" sub-element will be written for interaction 1.

      In the older versions of Moodle (tested in 1.9.4) the API checks each time LMSCommit() is called if the values stored in the CMI object are different from their default values defined in the spec, and if they are then it creates a post array containing all the non-default values and AJAXs that back to the DB to be saved. The downside of this is that for large SCOs that track a lot of data every value is being sent each time LMSCommit() is called.

      In the newer versions of Moodle (tested in versions 2.0, 2.1 and 1.9.10) the control logic is a little different. When the code identifies during a call to LMSCommit() that a non-default value has been set for a field it updates the internal reference for that field's default value to match the value that has been set. Consequently when LMSCommit() is called again it only sends values that have change since the last call. However the object used by the API to store the default values (datamodel) uses the 'n' style notation (e.g. cmi.interactions.n.result) and not the number style notation (e.g. cmi.interactions.1.result) so the supposed "default" values of all the interaction and objective sub-elements get repeatedly overwritten and messed up.

            danmarsden Dan Marsden
            evanirvingpease Evan Irving-Pease (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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