But, yep, sure enough it's true: Storyline courses can display a learner's full name, first name, or last name pulled from the PeopleSoft ELM (and maybe your LMS, too), in ANY course. And the best part? It's EASY--just one trigger, one variable, and one text box!
Here's how...
1. Open your Storyline .story course file.
2. On the first slide (usually the title slide), insert a new trigger to:
- Action: Execute JavaScript
- Script: Click the '...' button to open the JavaScript window and paste this text:
var player = GetPlayer();
var myName = lmsAPI.GetStudentName();
var array = myName.split(',');
var newName = array[1] + ' ' + array[0];
player.SetVar("newName", newName); - Click OK
- When: Timeline Starts
- Object: 1.1 Title Slide (or whichever of your slides is first)
- Click Ok
4. Insert a text box on the slide where you want the name to appear. In that text box, type: %newName%
This is what your first slide should look like with the Slide Trigger to Execute JavasScript. |
This is what your text box slide will look like. |
If you want only your user's first name (instead of their full name), use the same process, but:
1. Substitute this JavaScript text:
var player = GetPlayer();
var myName = lmsAPI.GetStudentName();
var array = myName.split(',');
var firstName = array[1];
player.SetVar("firstName", firstName);
2. Create a new text variable and name it 'firstName'.
3. Insert a text box on the slide where you want the name to appear. In that text box, type: %firstName%.
You can use both of these options in the same course. For example, maybe you want to welcome the learner to the course using their fist name only, then create a certification of completion at the end that includes their full name.
Here's a link to the .story file: https://dl.dropboxusercontent.com/u/16149154/GrabNameFromELMTest.story
Just another great example of how you and Storyline can make it happen!
Hi , What is the lmsAPI ? in var myName = lmsAPI.GetStudentName();
ReplyDeleteIs that common for all lms and if not how to find the API value ?