lmsAPI Functionality in HTML5 Output

Hey all,

I've been searching through the forums and haven't been able to find anything solid.  I'm using Storyline 360, outputting to both HTML5 and Flash to cover my bases, since the audience doesn't have dedicated machines that they are taking this from.

I'm relying heavily on external Javascript that I wrote, which I have tested thoroughly in the Flash version, and it works fine.  But when it comes to the HTML5 version, it stops working.  I've proven that I'm able to get into the Javascript functions, like I would expect, but it appears that lmsAPI is no longer available to the course.

Are there any similar functions to those of the lmsAPI functions in the HTML5 output?  

Specifically, I'm looking for a way to do the following in HTML5:

  1. Get the StudentID from the LMS.
  2. Get the StudentName from the LMS.
  3. Manually call SetStatus("completed"); to pass a completion to the LMS on the last page of the course.
144 Replies
Paul Schneider

No.  This information isn't part of what SCORM sends so there is no standard way to do this.  IF you LMS provided an API (or a 3rd party tool that works with your LMS data) that you could query you could send the student ID (which you can get) - query the API and then pull that info back in. 

FYI this is something that you can't (and can do as described) with pretty much every authoring tool that supports Javascript.  It isn't a restriction (or otherwise) of Storyline.

Sameeksha Mishra

Hi Adam Trosper,

I am trying to call LMSCommit from storyline 360 but nothing is happening? Actually we are trying to achieve a functionality where the learner will get a popup if the internet connection is lost. Currently even if the internet connection is lost, the learner is able to move to teh next slides and when they close the course they don't see the completed status on LMS. 

Please help me with this.

E-Learning Rosenbauer

Hi Sameeksha, Hi Leslie

Attached is my SL360 example of the "Connection Check".

It is a derivate of one of my work, so I guess there is much JavaScript inside you probably do not need, but it works without code-cleanup on your side.

All the "magic" is done within the Master Slide.

@Leslie: I do not know if you can open it in SL3, but give it a try and let me know. Otherwise we need to find another solution for you, as I do not have SL3.

If you have questions, just let me know.

 

Bruce Roberts

Hi Chris,

Many thanks for this, sadly, this does not open in my slightly not as great SL3 :-)

However, in this instance, as I want to capture user entered variables and not just show the name in the lesson, I have hit upon the "Guestbook" feature in AO.  Any lesson can be preceded with a form/questionnaire prior to launching.  As we plan to create learner logins in AO using a list of email addresses and system generated passwords, the Guest book Automatically captures the email address as the unique identifier. It is possible to add multiple custom questions.  Any field has options as to whether the question is mandatory or optional.  This will give us all the variables we need and then we can subsequently deliver the training package.

Just a couple of points to note:
1. if you test the Guestbook as Admin and then log in as a second user to test, do this on a different PC else the Guestbook considers you have already completed it. (Clearing cookies does not resolve this).
2. If you delete the lesson and recreate the lesson with the same name, the Guestbook is not deleted and old data fields are included in any new report.

Adam Trosper

@Bruce: I would suggest opening a new thread for this, since it does deviate pretty far from the original thread.  I don't have any experience with Guestbook or Articulate Online, so the only help I can offer is to dig through the code like I did originally.  I used Google Chrome's Dev Tools while I had an instance of the module running in the environment that was giving me issues, and I basically used the whole "code hints / suggestions" feature in the Console to explore the code until I found the solution I needed.

Sameeksha Mishra

Hi Chris,

Thank you so much for your help. There is one more point where I would like you to advise me:
Is there a way we can capture the LMS timeout just the way we are capturing network disconnection?

Currently our learners are facing a problem where they accidently close the LMS window however continue the training. However once they complete the training and exit it, the completion status is not updated because either they have closed the LMS main window or the LMS has timed out.

Let me now if you have done something similar to this.

Sameeksha

Bernardo Suero

Ashley,

The fix that Matt mentions (December 12, 2017 Build 3.11.14180.0) is for Storyline 360. I have Storyline 3, read thru the various builds for it and have not seen this fix.  I've tried implementing the suggestions mentioned in this discussion (use a JavaScript trigger to return user's name from LMS, SCORM 2004, HTML5) but have not been successful.

Earlier in this discussion you mentioned how the player was rewritten between Storyline 2 and Storyline 3/360 and this rewrite is what brought about this issue.  Are there plans to fix Storyline 3 in the same manner?

Bernardo

Ashley Terwilliger

Hi Bernardo,

Storyline 3 Update 4 would include all the fixes you see in Storyline 360 up to Update 3.15.15581.0. Are you on that update of Storyline 3?

We haven't made changes to how the player was rewritten yet to account for these Javascript customizations, but we'll let folks know if we do or build in those specific items folks were using. 

stephanie Martin

Hi Chris, I try to do the same thing but I don't know where to define the variable newName...
i put a trigger to execute the js in the begining of my page
i put the variable in the list of variable and decide is a text variable
i put a text field il my page with the variable inside

i published in html5
i have sl 360
and i tried in my lms and it doesn't work...

could you help me ?

Astutis Articulate 3

Hi there.

Firstly, I'd just like to say thanks to everyone that's contributed to this thread, as it's helped me with a project I'm working on.

I'm a bit stuck with one thing though. I'm trying to report the following details to an LMS for a confidence based multiple choice assessment:

  • The answers that the user selected.
  • The user's final 'knowledge' score (based on how they answered the question).
  • The user's final 'confidence' score (based on how confident they were about their answer).
  • The user's final 'combined' score as a percentage (based on both their knowledge and confidence).
  • Whether they passed or failed (based on the final 'combined' score).

I've got the answers for each question being reported by using Storyline's built-in multiple choice quiz slides. I've also got the 'knowledge' and 'confidence' scores being reported by using hidden 'How many' survey slides. The final percentage score is being reported using bits of different Javascript code that I've found in this thread. The bit I'm stuck on is the 'Passed/failed' reporting.

I think it's currently taking the passed/failed status from the built-in Results.ScorePoints variable, which is the same as the 'Knowledge' score, as it's just based on whether the answers were right or wrong. This isn't taking the confidence score into account.

I've tried using the Javascript code recommended in this thread, but it doesn't seem to be overwriting it. I need to have the tracking based on the quiz result slide, as otherwise the answers aren't passed to the LMS. Is there any way to make the Javascript code overwrite the passed/failed status?

Here's the code I'm using. I'm a complete novice when it comes to coding, so it's possible the mistake being made is in here somewhere:

var p = GetPlayer();

var passingScore = "14";

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 cs = p.GetVar("finalscore");

var currentScorePercent = p.GetVar("finalscore_percent");

var ns = 2;

var currentScorePercent = Math.round(cs / ns * 10);

p.SetVar("finalscore_percent", currentScorePercent );

lmsAPI.SetScore(currentScorePercent, 100, 0);

if (player.GetVar("finalscore")>= passingScore)
{
SetStatus("passed");
} else {
SetStatus("failed");
}

The status is set to be reported as 'Passed/Failed' in Storyline, although I've tried pretty much every option and none of them are working correctly.

I want the status to show as failed if the 'combined' score percentage is less than 70%, or if the 'combined' score is less than 14.

I've tried a few different things in the code, but was wondering if someone with more coding knowledge would be able to see something obvious that I'm not seeing. Or if what I'm trying to achieve is just not possible when the tracking is based on the quiz results slide.

Thanks.

Karuna Reddygari

Hello Astutis,

May be you can set a trigger in the  results slide or the final slide like the following .

{Complete course

when the time line ends

if combinedscore is greater then or equal to passing score}

Then the track the results by setting the tracking options as Track using complete course trigger