Get User.Id from LMS as variable in Storyline
Aug 17, 2016
Hi group
Is it possible to execute an lmsget or similar to get values from the lms (e.g. student.id, sudent.name, and put the result into a variable in Storyline?
If the answer is yes, are there any code examples to demonstrate it? I found something like that but I can't get the User.Id only the User.name whit this code:
var myName = lmsAPI.GetStudentName();
var array = myName.split(',');
var newName = array[1] + ' ' + array[0];
player.SetVar("newName", newName);
//myName = player.GetVar('myName');
//player.SetVar("newName", newName);
Thanks
9 Replies
have you tried using lmsAPI.GetStudentID
Hi Eduardo,
A bit older discussion but a lot of examples and further ideas here. As you likely also know, Javascript isn't something that staff can offer support for, but we do have some general best practices documented here.
Hi Phil,
Yes but %newname% is equal to "undefinided". How can I get a number or code?
regards...
This should be what your javascript looks like
You will need a text variable in Storyline called "myStudentID"
Thank You Phil,
It works!
Glad that Phil was able to assist you here Eduardo. I just wanted to mention that it looks like a signature line was included in your reply. This could happen if you replied via e-mail. You are welcome to pop in and edit if needed.
Thank you Leslie.
Hello Phil,
I am a new user from Storyline. Is it possible that you give me a step by step instructions. Where I have to enter which value in articulate.
Regards,
Jochen
Hi Jochen,
Thanks for reaching out here again - I know Phil is still active in the ELH Community, but in case he's not subscribed here you could try using the Contact me button on his profile to reach out.
This discussion is closed. You can start a new discussion or contact Articulate Support.