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

when setting cmi.objectives.0.id in a sco, there are javascript errors that prevent the sco from finding the lms

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.7, 1.7.1
    • Fix Version/s: 1.7.2
    • Component/s: SCORM
    • Labels:
      None
    • Environment:
      scorm 2004
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_17_STABLE
    • Fixed Branches:
      MOODLE_17_STABLE

      Description

      the error is located in moodle\mod\scorm\datamodels\scorm_13.js.php, somewhere around theese lines
      <?php
      $count = 0;
      $objectives = '';
      foreach($userdata as $element => $value){
      if (substr($element,0,14) == 'cmi.objectives') {
      preg_match('/.(\d+)./',$element,$matches);

      the output javascript that produces the error:
      cmi.objectives..N0 = new Object();
      cmi.objectives..N0.score = new Object();
      cmi.objectives..N0.score._children = score_children;
      the api is than broken, and the sco's cannto talk with the lms anymore.

      the bug is triggered when the sco sets "cmi.objectives.0.id". the next time you will enter the course, the javascript code will generate an error, and prevent the api from initializing

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            danmarsden Dan Marsden added a comment -

            Hi Piers,

            can you please check this? - the commit messages suggest this may only be partially fixed in HEAD - more stable files had patches committed than the files in HEAD - haven't had a good look though - you may just be able to close this bug.

            thanks!

            Dan

            Show
            danmarsden Dan Marsden added a comment - Hi Piers, can you please check this? - the commit messages suggest this may only be partially fixed in HEAD - more stable files had patches committed than the files in HEAD - haven't had a good look though - you may just be able to close this bug. thanks! Dan
            Hide
            piers Piers Harding added a comment -

            Checked this across HEAD, 1.9, and 1.8 - all looks consistent with respect to handling of the array elements.

            Show
            piers Piers Harding added a comment - Checked this across HEAD, 1.9, and 1.8 - all looks consistent with respect to handling of the array elements.

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  30/Mar/07