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

Scorm 1.2 LMSSetValue no save values if it is equal to default value (initial value at lms init)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 1.9.9
    • Fix Version/s: 1.9.10
    • Component/s: SCORM
    • Labels:
      None
    • Environment:
      Any platform
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      The problem is lmsetvalue no save value if it's equal to inital/default value. This problem occur when the course save the scorm values (LMSCommit function) some times in the course learning. In scorm run-time enviroment book Version 1.2 there are no restrictions to call lmscommit function some times in the course, then the error you can reproduce with this steps.

      Steps to reproduce the problem with a scorm 1.2 course:

      1.- Init course and recover default values, in lesson_location there are default value 3
      2.- Go to lesson 5.
      3.- LMSSetValue lesson_location 5
      4.- LMSCommit. Then moodle check: if 5 not equals to 3 then save into database lesson_location to 5 else no save, in this case save to DataBase
      5.- Go to lesson 3
      6.- LMSSetValue lesson_location 3
      7.- LMSCommit. Then moodle check: if 3 not equals to 3 then save into database lesson_location to 3 else no save, in this case NO save to DataBase

      In this moments if you leave the course and enter in it anothertwelve, then you will have lesson_location to 3 but the last save value is 5 and it's incorrect because you leave the course in lesson 3.

      This check and problem is in line 544 of mod/scorm/datamodels/scorm_12.js.php

      if (eval('datamodel["'+elementmodel+'"].defaultvalue') != data[property] || eval('typeof(datamodel["'+elementmodel+'"].defaultvalue)') != typeof(data[property]) ) {

      There are some scorm data models must saved forever, as cmi.core.lesson_location, cmi.core.lesson_status, cmi.core.score.raw, cmi.core.score.min, cmi.core.score.max, cmi.core.session_time

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                danmarsden Dan Marsden
                Reporter:
                damiles David Millán Escrivá
                Tester:
                Nobody
                Participants:
                Component watchers:
                Damyon Wiese, Dan Marsden, Matteo Scaramuccia, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  25/Oct/10