Using Javascript via a Trigger
Oct 23, 2017
Hi,
With success .. I have previously been able to send our LMS complete/incomplete along with a % complete score.. using the javascript below and actioned via a Trigger.
/*Get player to reference*/
var player = GetPlayer();
/*get LMS API*/
var lmsAPI = parent;
/*set score; the first number is the score*/
lmsAPI.SetScore(player.GetVar("RoleModelComplete"), 100, 99);
/*set status; possible values:"completed","incomplete", "failed","passed"*/
if (player.GetVar("RoleModelComplete")>=99)
SetStatus("completed");
if (player.GetVar("RoleModelComplete")<=99)
SetStatus("incomplete");
The RoleModelComplete score builds up throughout the learning via a series of checkboxes
I'm now working on updating the original learning and have found that when I pass the score to the LMS it passes the score on the previous slide even though rolemodelcomplete shows at 100%
I can't seem to find what I'm doing wrong?
I've since created a slide that learners are taken too if they choose to exit but that's not passing the score through either.
Where do I need to place the trigger so that the LMS captures the right % score?
Can someone take a quick look for me please - I think I've been going round in circles.
4 Replies
Sorry - file attached
That does make sense thank you - I'll try that.
Thank you - that has worked - it now passes Complete / Incomplete status back to the LMS - along with a score providing it's below 99% - once the score hits 100% it doesn't report the score back to the LMS - can you see if I've gone wrong in the code above?
Thank you - whilst this 'completes' if the learner achieves 100% that score doesn't show in the LMS. (Only scores 99 and below appear??)
Likewise if the user only completes 50% and then visits again at a later date - the score reporting back to the LMS is still the 50% - although the learning might complete??
Have you any idea why this might be?
Thanks
Lind
This discussion is closed. You can start a new discussion or contact Articulate Support.