get value of %Result.ScorePercent% back in variable when revisiting course

May 12, 2015

Dear all,

your help is appreciated! I´m running Storyline 2 - Rev 5

Situation:

I created a course guiding learning first time through a learning tunnel.

At the end of course learner has ta answer 10 questions, passing percentage is 80.

When revisiting course there are two options:

a) learner %result.ScorePercentage% is <80 and learner is running course again through learning tunnel

b) learner has passed with %result.ScorePercentage% is >=80 the an alternative menue enables learner to select any chapter and quizzes are hidden.

Issue:

I created variable "Bestanden=%result.ScorePercentage%" (german word for passed) . Jumping to next slide is conditioned by value of variable (<80 or >=80). When revisiting e-Learning %result.ScorePercentage% or "Bestanden" must be set on candidates result.ScorePercentage

LMS:

LMS saves score and it can be displayed in Java by SCORM_GetScore()

My idea (not working jet):

I created a trigger on first slide:

Execute JavaScript when timeline starts

running following JavaScript:

var score = SCORM_GetScore();
var player = GetPlayer();
player.SetVar("Bestanden",score);

Has anyone of you an idea?

4 Replies
Matthias Wiehn

Hello all,

I had a very good conversation with Steve Flowers. many, many thanks to Steve sharing your knowledge. Please find below Steves answer that was very helpful.

Steve wrote:

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

Couple of ways I can think of to get this done. SCORM_GetScore is the internal method the Flash based player uses. It works sometimes but using the lmsAPI would be more reliable and would also work in HTML5.

lmsAPI=parent;
var player=GetPlayer();
var score=lmsAPI.GetScore();
player.SetVar("Bestanden",score);

If that doesn't work, try this:

//comment the lmsAPI parent reference
//lmsAPI=parent;
var player=GetPlayer();
var score=lmsAPI.GetScore();
player.SetVar("Bestanden",score);

The other thing that occurs to me. This needs to happen and complete execution before your variable is evaluated. When triggers execute in Storyline, the JS triggers will start then it will move on to the next trigger. If the JS trigger doesn't finish before your next trigger, the variable you're looking for won't be there yet. I solve this by using delays. Either put the JS trigger on the base layer and the dependent triggers on another layer. Or, even better, delay the execution of your triggers using timeline delays.

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

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