Forum Discussion
lmsAPI Functionality in HTML5 Output
Hey all,
I've been searching through the forums and haven't been able to find anything solid. I'm using Storyline 360, outputting to both HTML5 and Flash to cover my bases, since the audience doesn't have dedicated machines that they are taking this from.
I'm relying heavily on external Javascript that I wrote, which I have tested thoroughly in the Flash version, and it works fine. But when it comes to the HTML5 version, it stops working. I've proven that I'm able to get into the Javascript functions, like I would expect, but it appears that lmsAPI is no longer available to the course.
Are there any similar functions to those of the lmsAPI functions in the HTML5 output?
Specifically, I'm looking for a way to do the following in HTML5:
- Get the StudentID from the LMS.
- Get the StudentName from the LMS.
- Manually call SetStatus("completed"); to pass a completion to the LMS on the last page of the course.
146 Replies
- DonAnthonyManueCommunity Member
Hi guys... I am trying to create a certificate on a slide, following the assessment that will pull variables from SCORM (student name / today's date) and then allow me to print.
I've seen people mention to Print that you would need a flash object. Our organization no longer supports Flash at all.
Any help? - ChrisPim-7dc640Community Member
Try this:
---------------------------
if (document.location.href.indexOf('html5') < 0) {
GetPlayer().printSlide()
} else {
if(!window.hasPrintStyle){
window.hasPrintStyle = true;
var css = "@media print {div.controls.grid-row.inflexible,div.area-secondary.cs-left.inflexible,header.header-primary.centered-title.extended-height,div.presentation-wrapper:after {display:none !important; visibility:hidden !important;}}";
head = document.head || document.getElementsByTagName('head')[0];
style = document.createElement('style');
style.type = 'text/css';
if (style.styleSheet){
style.styleSheet.cssText = css;
} else {
style.appendChild(document.createTextNode(css));
}
head.appendChild(style);
}
window.print();
} - AdamTrosperCommunity Member
If that doesn't work, the way that I've printed in the past was to use Execute Javascript to essentially create a new window with the certificate I wanted to print created on it using HTML. The one piece of advice I have about printing is that different browsers handle printing just a little differently, and you will have to account for that. Also, I always include a "print" button on the page that will disappear when clicked, in case they want to print a second copy, the cancel the print job, etc.
- TravisThompson1Community Member
Matthew...THANK YOU
- StephaniePownerCommunity Member
Hi, please could you let me know if the bug relating to passing completion status to the LMS with HTML5 output, has been fixed now. Thanks.
Hi Stephanie,
The issue with Javascript code no longer sending completion status to LMS in Storyline 360 and using HTML5 output, is still an open issue based on the changes made to the publishing engine in Storyline. Our team is looking at ways that we could incorporate these features for you and others to use in the future, but in the meantime you'd want to use the built in completion elements from the results slide or publishing properties.
- StephaniePownerCommunity Member
Hi Ashley
Thanks for the information. There was an issue with the built in Scorm reporting for HTML5 courses, which is why I was trying to do down the javascript route. However, I have been contacted by your support team to say that this has been fixed in the update made available this evening. Hopefully that will sort the problem as I am very keen to move to HTML5 output asap due to the ever increasing restrictions on Flash player use.
Thanks again
Sounds great Stephanie. Thanks for the update.
It looks like your email signature came through when you replied via email. You can remove that if needed by clicking ‘Edit’ beneath your response. Here’s a quick Peek video if you need help.
Hi Matthew and Stephanie,
Just a quick clarification here - the issue fixed was Javascript triggers that would set Storyline variables based on using the LMS API. So that would be pulling data from the LMS such as the users' name, etc. This does not change the behavior for setting the completion using Javascript in Storyline 3/360. That is something our team is still looking at based on the changes made to our publishing engine, and ways it could be added as a new feature for Storyline.
- BernardoSueroCommunity Member
Ashley,
The fix that Matt mentions (December 12, 2017 Build 3.11.14180.0) is for Storyline 360. I have Storyline 3, read thru the various builds for it and have not seen this fix. I've tried implementing the suggestions mentioned in this discussion (use a JavaScript trigger to return user's name from LMS, SCORM 2004, HTML5) but have not been successful.
Earlier in this discussion you mentioned how the player was rewritten between Storyline 2 and Storyline 3/360 and this rewrite is what brought about this issue. Are there plans to fix Storyline 3 in the same manner?
Bernardo
Hi Matthew,
It should work as long as it's using the lmsAPI piece. Let me know if you run into any trouble testing it and I can get it connected with our team.
- ScottReadettCommunity Member
I know its been a while Adam since you responded to this post - but thank you (and Chris) for working through a solution - It has saved me needing to review and update weeks worth of projects.
Thanks!!!
Related Content
- 3 months ago
- 4 months ago
- 10 months ago