I checked that the username appears if exporting in FLASH, if exporting in another different mode (HTML5 / FLASH, HTML5, FLASH / HTML5) does not appear. I need a Javacript for HTML 5 mode
The Javascript documentation here for Storyline 3 includes a few examples that you could use, although they're not something we'd offer support for.
There were some variables thats users had accessed in Storyline 2 (without Articulate documentation) that aren't working in Storyline 3 or 360 based on the changes we've made to our published output. If you'd like our team to confirm that you're running into one of those scenarios, we can take a look at your .story file if you'll upload it to our Support Engineers at this link.
Here is the code I used for Moodle. It may differ to what you need for your LMS.
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); var player = GetPlayer(); var myName = lmsAPI.GetStudentName(); var array = myName.split(','); var last = array[0]; var first = array[1]; first = first.substring(1); var firstChar = first.charAt(0); var lastChar = last.charAt(0); var fandl = firstChar.concat(lastChar); var fullname = first.concat(" ",last); player.SetVar("Name", fullname); player.SetVar("Initials",fandl); player.SetVar("Firstname",first);
8 Replies
I checked that the username appears if exporting in FLASH, if exporting in another different mode (HTML5 / FLASH, HTML5, FLASH / HTML5) does not appear. I need a Javacript for HTML 5 mode
Hi Luis,
The Javascript documentation here for Storyline 3 includes a few examples that you could use, although they're not something we'd offer support for.
There were some variables thats users had accessed in Storyline 2 (without Articulate documentation) that aren't working in Storyline 3 or 360 based on the changes we've made to our published output. If you'd like our team to confirm that you're running into one of those scenarios, we can take a look at your .story file if you'll upload it to our Support Engineers at this link.
FYI link to examples doesn't work. (goes to salesforce login)
Hi Paul,
Sorry about that - I've updated the link and you can also see it here: https://www.articulate.com/support/article/Storyline-3-JavaScript-Best-Practices-and-Examples
Hi Paul,
Did you manage to resolve this? I just had to work through the same issue and found this thread which has the code you need.
thanks Paul. But you solved the issue?
Here is the code I used for Moodle. It may differ to what you need for your LMS.
I have not.
This discussion is closed. You can start a new discussion or contact Articulate Support.