Help with 1.2, time, and Storyline

Mar 20, 2014

Hello Heroes!

I am somewhat inexperienced with Javascript and very much so with SCORM 1.2. I am having issues trying to bring cmi.total_time into Storyline (particularly for HTML5) and was hoping to get some help. 

Based on reading these community pages, I have found the following example of retrieving a student's name:

-------------------

var player = GetPlayer();

var myName  = lmsAPI.GetStudentName();

var array  = myName.split(',');

var newName = array[1] + '  ' + array[0];

player.SetVar("newName", newName);

-------------------

The above example Works for me in the SCORM Cloud, however when I try to modify it and use GetPreviouslyAccumulatedTime() - which as I understand it, retrieves total_time - I hit the wall.  I'm almost positive this is due to my rusty javascript skills and/or lack of 1.2 experience, and was wondering if there is a hero out there who can steer me on the right path? Again, looking for an HTML5-friendly function that can bring total_time (or any time-related value really...) into Storyline. Any help would be most appreciated!!

-Ben

5 Replies
Ben Keszler

Thank you for your reply Phil!

As I understand it, time from the LMS is numeric, in milliseconds. As for the javascript, I was trying to modify the "Name+JS+Demo" that you reference: http://community.articulate.com/forums/p/15117/87588.aspx#87588 (which - by no coincidence - is where my limitations with both 1.2 and javascript must come into play  lol). That javascript looks something like:

------------------------------------

var player = GetPlayer();

var myName  = lmsAPI.GetStudentName();

var array  = myName.split(',');

var newName = array[1] + '  ' + array[0];

player.SetVar("newName", newName);

------------------------------------

In further reading there was also mention that this would not work in HTML5... if this is the case, is there perhaps another means of getting LMS time values into SL that you could recommend? One that plays nicely with HTML5?

I am still a bit green with this, so please forgive me if I am not providing the needed info... and thank you so much for your time and any advice you may have!

-Ben

This discussion is closed. You can start a new discussion or contact Articulate Support.