Copy link to clipboard
Copied
Hi,
For years, we've used a small piece of java at the end of our software simulations produced in Captivate. When the user clicks this, they advance to the next page in the main e-Learning course (developed in Composica):
setTimeout(function() {
Navigation.next();
}, 100);
We've recently moved to Articulate Storyline 2 for e-Learning development, and the old code doesn't work. From searching online, I found this discussion https://community.articulate.com/discussions/articulate-storyline/web-object-how-to-advance
I created the variable within Storyline, and the trigger. In Captivate (7.0.1) I am now using the code:
var player=parent.GetPlayer();
var currentTime = new Date();
var uniqueTime=currentTime.getTime();
player.SetVar("goNext",uniqueTime);
Taken from this website: Web Object..how to advance - Articulate Storyline Discussions - E-Learning Heroes
The problem I am now experiencing, is that when the course is published to 'CD' from Storyline, the code works perfectly in both SWF and HTML5 outputs. If I publish to a spare webserver/FTP I have, then the SWF based content also works perfectly - HTML5 doesn't load but that's another issue.
However, when I publish to SCORM 2004 in Storyline, this breaks my Captivate SWFs, and they do not advance to the next e-Learning slide when the button is clicked.
I've read this may be due to the LMS/SCORM package not interpreting the javascript from Captivate correctly. This discussion Javascript Print Code won't work on LMS/SCORM mentions the need for separate javascript, possibly including "window.cpAPIInterface."
Can anyone see/suggest a quick fix to my current Captivate code to allow for it to work with a SCORM-compliant LMS?
Thank you for any help you can offer.
Message was edited by: Joe Boss
It sounds like you have a parenting issue. In an LMS, usually the course rides in another page in a frame which has the SCORM API wrapping the course.
You need to set up a console.log to see the value of player.
add this script in the Captivate file where it is executing the JavaScript.
console.log(GetPlayer(),parent.GetPlayer(),parent.parent.GetPlayer())
Put that line before any other scripts. Press F12 and select the console tab and see what the output is. There should be 3 different putputs and i
...Copy link to clipboard
Copied
Not sure how you actually have this setup? How is the Captivate inserted in Storyline?
Haven't worked in CP7 for some time, but I do not believe the cpAPIInterface object is available in that version. The code then needs to determine whether it is swf or HTML5 and make the code adjustment from there.
Copy link to clipboard
Copied
Hi thanks for the quick reply.
In Storyline 2, on the Slide Master, I have a text variable named goNext. I then have a slide trigger, 'Jump to next slide when goNext changes'. This is in line with the code on a previous link.
The Captivate has a couple of slides, the last of which has a clickbox, that triggers the goNext javascript mentioned earlier.
In this test environment, I've inserted a Flash SWF file, created from the Captivate above. This is a simple Storyline 2 test project with a few slides. The SWF is on 1.1, the next page (1.2) has a text box just to confirm it's jumping to the next slide properly. Later on in the project (page 1.3), I've published the same content from Captivate, but this time as HTML5. Accordingly in Storyline, I've inserted this as a Web Object.
If I publish to CD, and run the .exe, it all works beautifully.
If I publish to web, and upload to a standard FTP, the SWF versions work absolutely fine, the HTML5 just shows a brief spinning loading, then doesn't display the animation.
If I publish to SCORM 2004 then upload, the SWF loads and I can navigate through, but I can't complete the final action that would trigger the javascript (nothing happens). The HTML5 animation doesn't load.
Hope that clarifies.
Thanks
Joe
Copy link to clipboard
Copied
It sounds like you have a parenting issue. In an LMS, usually the course rides in another page in a frame which has the SCORM API wrapping the course.
You need to set up a console.log to see the value of player.
add this script in the Captivate file where it is executing the JavaScript.
console.log(GetPlayer(),parent.GetPlayer(),parent.parent.GetPlayer())
Put that line before any other scripts. Press F12 and select the console tab and see what the output is. There should be 3 different putputs and it's possible that an error is being thrown if you are trying to execute script based on the variable "player" if it is undefined.
Copy link to clipboard
Copied
Thanks for your post and that theory makes sense.
Ignore the below. I did some more searching, and I then tried the code mentioned previously, without the Parent tag around getPlayer.
This seems to have worked! ![]()
Thanks again, will report back if any further linked issues. Need to establish why HTML5 content doesn't load but that's something for another day.
I've added that code into my Captivate's final slide, and I was assuming you're wanting that to be added to an Articulate course and published to SCORM?
I've tried that way, and also tried just outputting to a SWF from Captivate and launching the HTML. Using IE11 (Windows 7), when I press F12 and click the Console tab, I'm not seeing anything obvious.
If I try to view it in the published SCORM, nothing appears in the console, even when trying to adjust the Target from the drop-down menu.
If I launch the HTML on it's own (this doesn't show any additional options on the Target drop-down), before I've even clicked, I get:
HTML1300: Navigation occurred.
File: about:blank
HTML1527: DOCTYPE expected. Consider adding a valid HTML5 doctype: "<!DOCTYPE html>".
File: about:blank, Line: 1, Column: 1
HTML1405: Invalid character: U+0000 NULL. Null characters should not be used.
File: about:blank, Line: 1, Column: 14
HTML1507: Unexpected character: U+0000 NULL. Null characters should not be used.
File: about:blank, Line: 1, Column: 14
But, I don't see anything else once I click on the navigation button that triggers the javascript in Captivate.
Sorry if I'm missing something obvious.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more