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

JavaScript error trying to launch SCO with wrong id (Using MDL-27036 AICC HACP test package)

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 2.5.1, 2.6
    • None
    • SCORM
    • None
    • MOODLE_25_STABLE, MOODLE_26_STABLE

    Description

      While trying to test AICC HACP on latest Moodle master branch (20/7/2013)
      I got the following JS error:

      Uncaught TypeError: Cannot read property 'url' of undefined 
      

      for the javascript scorm/module.js ~ 533 :

      scorm_first_url.title = scoes_nav[launch_sco].url;
      

      launch_sco has the wrong value (96) and should be 95.

      I am using the MDL-27036 AICC HACP test package. (Attached to this issue too)

      Digging into the code, I think I found the problem:
      scorm/locallib.php ~ 1775

      if (empty($scoid)) {
              $result->sco = $scoes['scoes'][0]->children[0];
          } else {
      

      Should, probably, be:

      if (empty($scoid)) {
              $result->sco = $scoes['scoes'][0]->id;
          } else {
      

      If changed, It seems to work fine. But, I am not sure I fully get the complexity of the code (after hours of xdebug!) so...
      Dan, What do you think?

      Attachments

        Issue Links

          Activity

            People

              danmarsden Dan Marsden
              nadavkav Nadav Kavalerchik
              Dan Marsden Dan Marsden
              Dan Marsden, Matteo Scaramuccia, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: