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
Glad to hear that works! No problem!
- AdamTrosperCommunity Member
I just realized that I never got an answer to #3 on my list:
In HTML5, how can I manually call SetStatus("completed"); to pass a completion to the LMS on the last page of the course.
It currently fails, saying that "SetStatus is not defined."
- JamesBonney-EDECommunity Member
Hi Matthew,
Will this completion code work with amount of screens viewed tracking?
- JamesBonney-EDECommunity Member
Ofcourse, sorry Matthew. First day back from holiday today. Jet lag and Storyline variables/JS just don't work well together.
Thanks again.
- AdamTrosperCommunity Member
HI Matthew,
That would definitely do the trick! I actually found another solution that works for HTML5 right now, but certainly isn't as direct as manually setting the lesson_status.
var lmsAPI = parent;
lmsAPI.SetReachedEnd(); - JamesBonney-EDECommunity Member
Hmm, Matthew, the code you provided doesn't seem to be working in HTML with our Moodle LMS. Should it?
Adam/Matthew, if I had a trigger for both codes you've provided, would that cause any issues? I will try your code now Adam, see if that works with HTML.
Thanks
- AdamTrosperCommunity Member
James - My guess is that the variable lmsAPI isn't equal to parent, but rather parent.parent, or something like that. If you use the findLMSAPI function (as I helped Chris with earlier in this thread), that might work. I don't personally work with Moodle, but Chris was having a similar problem with Moodle.
Let us know if that works!
- JamesBonney-EDECommunity Member
Thanks Adam. Apologies but I'm not totally clued up with JS so you may as well have been talking Chinese to me there.
Not sure what you mean, or how to type it out..
Thanks
- JamesBonney-EDECommunity Member
Adam - you're a saint!!! Perfect. Thank you so much.
If the module is using flash, will this still work?
Thanks again and for the fast replies!
- AdamTrosperCommunity Member
Good question. I think it works for both, but I would test it just to make sure.