Forum Discussion
Storyline and the Intellum LMS
Has anyone been successful creating a javascript that will pull the user's email address or login from the Intellum LMS? We'd like to do that so we can look at the domain and present different material to employees (with one email domain) and customers (with different email domains) using Storyline variables. Any success stories and code examples welcome!
4 Replies
- JoeFrancisCommunity Member
In our case, the employee UserIDs and the vendor/contractor UserIDs have different letter combinations to indicate to other systems what type the user is. If you could trap for a known letter/number combination for your employees in student_id, you could then assume those profiles which don't follow that scheme are customers, and segregate content accordingly.
- MikeHuffmanCommunity Member
Thanks, Joe! I was thinking the same thing and have been investigating if there are any other user information we could use to categorize the learners.
- SamHillSuper Hero
Hi MikeHuffman you can sometimes get lucky with an LMS (like SCORM Cloud) as they may have included that information in either in the cmi.core.student_id or cmi.core.student_name SCORM data model elements. There is no "universal" way to get that information from an LMS, as it is not always exposed via an API, but some LMS will use the users email as the student_id, therefore making it available to retrieve via JavaScript.
I have provided you with a Storyline file (attached) that will output the information from cmi.core.student_id and cmi.core.student_name so that you can see which information is available on your LMS.
If you find the LMS does store the email in one of those properties, the way I have set this file up is as follows:
- Create a Storyline variable to store the value. In my example, I have created a Storyline variable called student_id and student_name.
- Add the following JavaScript to the MASTERSLIDE and have it run on timeline starts trigger. The JavaScript gets the information from the LMS (SCORM 1.2 or SCORM 2004) and will then populate the Storyline variables with the value. I add to the MASTERSLIDE to ensure it will execute when needed. It will only execute once, when the Storyline variables do not contain values.
if(getVar('student_id') === '') setVar('student_id',GetStudentID()); if(getVar('student_name') === '') setVar('student_name',GetStudentName());
- If you do determine that the email address is available in one of those SCORM properties, just delete the Storyline variable you do not need and remove the script.
Tip: You can also use the student name to refer to somebody by their name in the module using the SCORM student_name value. It does need a little bit of extra manipulation using JavaScript, as SCORM always provides names in "Lastname, Firstname" format.if(getVar('firstname') === '') { const name = GetStudentName().split(', ') setVar('firstname', name[1]) setVar('lastname', name[0]); }
This is my results in SCORM Cloud:
Just publish the attached Storyline file to SCORM 1.2 or 2004.
- MikeHuffmanCommunity Member
Thanks, Sam! We were finally able to get in touch with someone at Intellum and it turns out they do not expose the email address to the API. :-( We're hoping they will change that for us (we're a pretty big customer), but will have to wait and see.
I appreciate the code! Much cleaner than what I had come up with. I'll keep it on hand in case they do change the API for us.