Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
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
});
}
});
Copy link to clipboard
Copied
@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?