Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

"moduleReadyEvent" only firing on first slide for responsive projects

New Here ,
Jul 25, 2016 Jul 25, 2016

We have been using captivate for awhile to create eLearning courses. We then upload to LearnDash using xAPI.

Pulling data from the captivate file was quite easy, by setting an event handler for "moduleReadyEvent" as per below:

window.addEventListener("moduleReadyEvent", function(evt) {

 

  // attach the captivate instances to the window

  cpInterfaceObj = evt.Data;

  eventEmitterObj = cpInterfaceObj.getEventEmitter();

 

});

Since switching to responsive projects (exported as HTML5), as far as I can tell this "moduleReadyEvent" is only firing on the first slide and even then it never seems to make it to this event listener.

We have "Send data on each slide" selected in the reporting preferences, so its a little confusing.

Are we approaching this incorrectly, or has something changed between the older files and the responsive ones?

Thanks in advance for your help!

TOPICS
Advanced
296
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 03, 2016 Oct 03, 2016

I'm no expert with Captivate but it seems to me that it treats the collection of slides in a course as one HTML page so the on ready event can only fire once.

What I think you need to do is to trigger on slider enter/exit events:

window.addEventListener("moduleReadyEvent", function(evt) {

  interfaceObj = evt.Data;

  eventEmitterObj = interfaceObj.getEventEmitter();

  if (interfaceObj && eventEmitterObj) {

    eventEmitterObj.addEventListener("CPAPI_SLIDEENTER",function(e) {

      // do something here on slide enter

    });

    eventEmitterObj.addEventListener("CPAPI_SLIDEEXIT",function(e) {

     // do something here on slide exit

    });

  }

});

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Oct 04, 2016 Oct 04, 2016
LATEST

@AP AW is correct that the moduleReadyEvent does only fire once for any project type.

The send data on every slide concerns SCORM only and has nothing to do with the Common JS Interface events.

It sounds like you have some other issue, it would help if you would describe what you are doing and what info you are not receiving or what is not working. Can you show the code that is not working?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources