Unique random generator to show slide layer
Jan 16, 2018
Hi! I have already been through several posts - and I'm using the random number generator to generate a number to correspond with slide layers:
var randomnumber = Math.floor((Math.random()*8)+1);
var player = GetPlayer();
player.SetVar("rndNumber",randomnumber);
What I'd like to do is improve this so that once it shows a particular layer, it won't show it again...
I am HORRIBLE with Java - so hoping someone can help? I've attached a screenshot to hopefully illustrate what I have done so far! Thank you in advance!!
5 Replies
Are you using Storyline 360 by any chance? If yes, than you can generate a random number without having to use JS.
No - Storyline 2, so I need the JS. Thanks for replying so quickly, Michael!
Kristin,
I'm also searching for this solution. I figured out how to make the used layer not appear again, but I don't know how to automate the random number generator to "re-roll" the dice after noticing the layer has already been displayed.
Thinking aloud...
How do we reset the available numbers from which the generator pulls? And if that is a possibility, how do we reassign that smaller pool of numbers to the remaining layers?
Would a True/False check of some sort work?
What else could work?
Christina - this was solved by Owen Holm - super helpful - here you go!
https://community.articulate.com/discussions/building-better-courses/trivia-game-using-variables-and-javascript-to-remove-answered-questions-from-the-deck
Thank you! Will check it out. : )
This discussion is closed. You can start a new discussion or contact Articulate Support.