Skip to main content
Participating Frequently
June 17, 2015
Question

SCORM package not being read properly in certain browsers.

  • June 17, 2015
  • 1 reply
  • 2146 views

According to my LMS, this is the gist of the problem:

"Root cause is this package which, with some browser-specific logic, is calling function "SCORM_CallLMSInitialize()" contained within scormdriver.js twice - once too many. First call successfully initializes the API, but second returns an error (as this function should not run twice)."


Trying to get someone on chat support to help me... still waiting.  But in the meantime - does anyone know how to fix this?


Thanks!

Wanda

    This topic has been closed for replies.

    1 reply

    TLCMediaDesign
    Inspiring
    June 17, 2015

    It is true that Initialize should not be executed twice. I've never had that issue with a Captivate course. When we create courses we use a start page that initializes then redirects to the content.

    What version of Captivate and SCORM are you using?

    You should be able to insert a variable in that function to stop it from executing twice. The bolded text is added:

    var initCalled = false;

    function SCORM_CallLMSInitialize() {
        if (!initCalled)
    {
      var strResult;
      WriteToDebug("In SCORM_CallLMSInitialize");
      SCORM_objAPI = SCORM_GrabAPI();
      WriteToDebug("Calling LMSInitialize");
      strResult = SCORM_objAPI.LMSInitialize("");
      strResult = strResult + "";
      WriteToDebug("strResult=" + strResult);
      if (strResult == SCORM_FALSE) {
       WriteToDebug("Detected failed call to initialize");
       SCORM_SetErrorInfo();
       WriteToDebug("Error calling LMSInitialize:");
       WriteToDebug("              intSCORMError=" + intSCORMError);
       WriteToDebug("              SCORMErrorString=" + strSCORMErrorString);
       WriteToDebug("              Diagnostic=" + strSCORMErrorDiagnostic);
       return false;
      }
      WriteToDebug("Returning true");
      initCalled = true;
      return true;
    }
    }

    Participating Frequently
    June 17, 2015

    I am using Captivate 7.  The SCORM packages in question were actually developed and published well over a year ago, and have been in use in our LMS since then.  It wasn't until a couple of months ago that the problem started, and thus started my constant back and forth between my LMS and Adobe for support, each stating the other is the issue.

    From what I understand, when I upload a SCORM zip file to my LMS, it unpackages it and creates a file called multiscreen.html - which I believe is supposed to initialize the content. I am copy/pasting below the entire message from my LMS support to see if that clarifies the issue and their suggestion.  I don't like to mess with the .js or .html files in the package, as I don't really have musth experience with that.  The suggestion that you posted - where would that go??  And do you still recommend that after reading the full email below?

    Thanks!

    Wanda

    Hello Wanda,

    I have the feedback from our developer team.

    - No changes in LE have been implemented that could cause this

    - Root cause is this package which, with some browser-specific logic, is calling function "SCORM_CallLMSInitialize()" contained within scormdriver.js twice - once too many. First call successfully initializes the API, but second returns an error (as this function should not run twice).

    We want to stress that nothing has changed on the LE side to cause this behavior. If this only started occurring for client recently, it is likely a result of using a different or updated browser (I can't reproduce original error with IE, but easily with Chrome)

    - Workaround -

    Adjust each package to avoid calling this method more than once, regardless of browser.

    For example, there is an iframe within multiscreen.html:

    <frameset rows="100%,0%,0%,0%,0%" onload="OnLoad_Activities()" border="0">

    <frame id="frame1" name="content" src="">

    </frameset>

    If this code is adjusted to NOT call function "OnLoad_Activities()", and instead directly set the "src" attribute, then original error alert doesn't occur anymore:

    <frameset rows="100%,0%,0%,0%,0%" onload="" border="0">

    <frame id="frame1" name="content" src="Math_Fractions_Time_Module4.htm">

    </frameset>

    We hope this helps your Course Designers implement a solution in your scorm packages.

    TLCMediaDesign
    Inspiring
    June 17, 2015

    It looks like you are going to need to edit files either way. The function I am talking about is in the scormdriver.js file, which is also in a template. So you fix it once and it's always fixed (if it solves the issue). The file is located here:

    C:\Program Files\Adobe\Adobe Captivate 7 x64\Templates\Publish\LMS\Standard\SCORM\Default\1_2\scormdriver.js

    You would just find the function referenced in my post above, and replace it with what I posted.