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.
- AdamTrosperCommunity Member
Hi Ilana,
Your code looks like it should be good. Unfortunately, I don't have a lot of time to dig through the code to try to help, but I would try to follow the path through the code to see what happens exactly when you call SetScore.
The reason I say that is because when I was having issues calling SetStatus('completed'), I just searched through the code, and ended up finding out that the SetStatus function is basically just a switch statement that calls a different function (lmsAPI.SetReachedEnd();). By calling this function directly, I was able to get my code to work. I'm hoping there's a similar situation for SetScore that you can find.
----------------------------------------------------------------------------------------
I really hope Articulate can get this bug fixed soon. I guarantee this is a bug that is out there causing all kinds of unnoticed problems for most Storyline users, since they usually don't have a dedicated QA team that verifies all their work on every device. But for that student who tries to take it on an iPad, it's going to fail repeatedly for "no reason", which is going to be very frustrating.
Thanks for checking in, Stephanie. We're still working through this bug. We thoroughly test our product updates to make sure that other features are not negatively impacted with fixes that we’ve built, and we wouldn’t want to commit to a date and release any builds that are not of superior quality. But you are in the right place, and we’ll be sure to let you know any further information we have to share as soon as we can!
- StephaniePownerCommunity Member
Thanks Alyssa. This is a show-stopper for a client who has a "no Flash" policy in their organisation and our course is compliance based so getting the correct reporting is crucial. I really hope this can be fixed soon.
- ilanaDuboviCommunity Member
Hello Matthew,
I'll appreciate very much your help with the SetScore issue.
Many thanks
- ilanaDuboviCommunity Member
Hello all,
Matthew send me a code update for SetScore issue which works perfect for sending score from HTML5 to LMS:
var player = GetPlayer();
function findLMSAPI(win) {
if (win.hasOwnProperty(" GetStudentID")) return win;
else if (win.parent == win) return null;
else return findLMSAPI(win.parent);
}
var lmsAPI = findLMSAPI(this);
lmsAPI.SetScore(player.GetVar( "zScores"), 100, 0);
if (player.GetVar(" 14543GameScore")>= player.GetVar(" 14543PassingPercentage"))
{
SetStatus("passed");
} else {
SetStatus("failed");
}Thank you Matthew, you are a life saver!
Ilana
- ChrisPimCommunity Member
Thanks Matthew.
Just to be clear - could someone explain what variables it is picking up - for example do I need to set a custom variable with a particular name etc?
Chris
- ChrisPimCommunity Member
That's brilliant - thank you so much. I really appreciate your time.
Chris
- jeremyusherCommunity Member
I've been trying to find a way to access the learner name for a while and never got round to it, your solution worked first time. No more asking learner to type their name in to get personalisation.
Many thanks
Jeremy
- DanielKochCommunity Member
Thanks so much, Matthew!!
I was trying different scripts, but yours was the first to work!Had a similar script for Flash, but not for HTML5.
- SamHammondCommunity Member
To piggyback on this conversation, I've noticed that the HTML5 output in SL3(60) does not utilize the lms.js file. Any custom changes you make to that file will not apply to HTML5 output.