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
- ChrisPerez-f9f6Community Member
Just wanted to report in - this is the working code for Cornerstone LMS using HTML5 and SCORM 2004 publishing in Storyline 360 if you just want the first name (variable in SL would be 'newName'):
var player = GetPlayer();
function findLMSAPI(win) {
// look in this window
if (win.hasOwnProperty("GetStudentID")) return win;
// all done if no parent
else if (win.parent == win) return null;
// climb up to parent window & look there
else return findLMSAPI(win.parent);
}
var lmsAPI = findLMSAPI(this);
var myName = lmsAPI.GetStudentName();
// remove last name from array
var array = myName.split(' ');
var newName = array[0];
player.SetVar("newName", newName); - JoLamontagne-8fCommunity Member
Following on from this thread, is there a way to call the student's line manager information from the LMS? I want to set up an auto generated email to the line manager for users that fail an assessment 3 times.
I'll be using the first set of coding to get the student information from the LMS. Wondering if there's an obvious way of generating their line manager too?
xxx
- PaulSchneiderCommunity Member
No. This information isn't part of what SCORM sends so there is no standard way to do this. IF you LMS provided an API (or a 3rd party tool that works with your LMS data) that you could query you could send the student ID (which you can get) - query the API and then pull that info back in.
FYI this is something that you can't (and can do as described) with pretty much every authoring tool that supports Javascript. It isn't a restriction (or otherwise) of Storyline.
- SameekshaMis875Community Member
Hi Adam Trosper,
I am trying to call LMSCommit from storyline 360 but nothing is happening? Actually we are trying to achieve a functionality where the learner will get a popup if the internet connection is lost. Currently even if the internet connection is lost, the learner is able to move to teh next slides and when they close the course they don't see the completed status on LMS.
Please help me with this.
- ChristophKri762Community Member
Hi Sameeksha
Do you mean something like this:
https://360.articulate.com/review/content/1da3e7d0-4fbd-4add-bbdd-6e989c8a54d5/review
Here you get a warning when connection is down and you can not go any furter until it is up again.
- SameekshaMis875Community Member
Hi Chris,
Bullseye! Yeah this is exactly what I am looking for. Can you tell me how you did it and I am using Successfactor as LMS so let me know if this will work on LMS as well.
If I will be able to make it work on LMS, that will be a great help.
Thanks again
Sameeksha
- SameekshaMis875Community Member
Also Chris I am using Storyline 360. Not sure whether you are using the same or not. And will this work in flash output.
Sameeksha
- ChristophKri762Community Member
It should work in LMS environment as HTML5 as well as in Flash.
I can provide you the. story file (SL360) on Thursday as I am out of office until then. The example is pretty strait forward.
- LeslieFosterCommunity Member
I am also interested in this for Storyline 3...if possible....
- SameekshaMis875Community Member
Thank you so much I will be waiting for you to return back.
Thanks a lot Chris. Have a great weekend!
Sameeksha
- BruceRobertsCommunity Member
Has anyone got any of this working in Articulate Online?
I'm particularly interested in getting the student first name: lmsAPI.GetStudentName.Apparently Articulate "...don't provide technical support for the Articulate Online API..."
- ChristophKri762Community Member
Hi Bruce
For me that works ("studentname" is the variable set in SL360):
var player = GetPlayer();
var str = GetStudentName();
var partsOfStr = str.split(',');
player.SetVar("studentname",partsOfStr[0]);
- ChristophKri762Community Member
Hi Sameeksha, Hi Leslie
Attached is my SL360 example of the "Connection Check".
It is a derivate of one of my work, so I guess there is much JavaScript inside you probably do not need, but it works without code-cleanup on your side.
All the "magic" is done within the Master Slide.
@Leslie: I do not know if you can open it in SL3, but give it a try and let me know. Otherwise we need to find another solution for you, as I do not have SL3.
If you have questions, just let me know.
- SameekshaMis875Community Member
Hi Chris,
Thank you so much for your help. There is one more point where I would like you to advise me:
Is there a way we can capture the LMS timeout just the way we are capturing network disconnection?Currently our learners are facing a problem where they accidently close the LMS window however continue the training. However once they complete the training and exit it, the completion status is not updated because either they have closed the LMS main window or the LMS has timed out.
Let me now if you have done something similar to this.
Sameeksha
- BruceRobertsCommunity Member
Hi Chris,
Many thanks for this, sadly, this does not open in my slightly not as great SL3 :-)
However, in this instance, as I want to capture user entered variables and not just show the name in the lesson, I have hit upon the "Guestbook" feature in AO. Any lesson can be preceded with a form/questionnaire prior to launching. As we plan to create learner logins in AO using a list of email addresses and system generated passwords, the Guest book Automatically captures the email address as the unique identifier. It is possible to add multiple custom questions. Any field has options as to whether the question is mandatory or optional. This will give us all the variables we need and then we can subsequently deliver the training package.
Just a couple of points to note:
1. if you test the Guestbook as Admin and then log in as a second user to test, do this on a different PC else the Guestbook considers you have already completed it. (Clearing cookies does not resolve this).
2. If you delete the lesson and recreate the lesson with the same name, the Guestbook is not deleted and old data fields are included in any new report.- ChristophKri762Community Member
Sorry Bruce.
I did not read it carefully enough.
I use code for the name with a different LMS and not AO.
- BruceRobertsCommunity Member
No worries Chris. Thanks for sharing. My AO query was a bit of a deviation from the thread :-)
Related Content
- 3 months ago
- 4 months ago
- 10 months ago