Forum Discussion
MathNotermans-9
3 years agoCommunity Member
Global scope for Javascript variables in Storyline
As Storyline publishes all code and variables to separate functions in the user.js file the scope for individual variables is local. The solution i show here creates a global scope for functions and...
MathNotermans-9
8 months agoCommunity Member
So testing your file...and disabling the next button on the 2nd slide i nicely get this console.log...
Appel de score : sit=1 , quest=1 , rep=1 , comp=1
val= 1 | valeur prec de sRes=0
On the suite button i changed the console.log to this...console.log("val= "+val+" | valeur prec de sRes=" + prec);
So apparently ( correct me if im wrong ) you get all proper data from your multidimensional array and all logs fine.
I suspect that Storyline goes to quick to the next slide, so i changed the nextSlide trigger to waiting for a new variable to change: nextSlideAllowed. Default it is false, thus atm not going to the next slide. Im gonna see whether i can set that variable to true, thus going to the next page and whether all works then.