randomizing questions from a game board

Jan 26, 2015

Hi all,

I'm creating a variation on a Snakes & Ladders game in Storyline, where two players move counters along a board according to the roll of a dice. When they land on particular squares, I want them to have to answer a random question correctly to either go up the ladder or avoid going down the snake.

With the aid of some javascript I have the game board, counter movement, and dice rolling working fine, but where I'm falling down is getting the questions linked to each snake or ladder to be random (so that each player and each playthrough sees a different random question for each snake and ladder when they land on it). I was hoping to use a lightbox and a randomized question bank, but each time I re-open the question bank it gives me the same (random) first question, even though it's already been answered. I was rather hoping it would remember the existing state and go through the questions in the random order it generated, but no such luck.

Has anyone attempted a game like this and has any suggestions? I've attached my design (which may well be more complicated than it needs to be), although the question functionality is basically not in there yet.


3 Replies
Alexandros Anoyatis

Hi James,

That's the thing with Random Quiz Banks, they are random, but the second time you go through them, they'll follow the exact same path.

I've asked this question myself a long time ago facing the same problem. It took me a year but at some point I figured it out, out of the blue.

The answer is to make a 'Random Grab bag' script. This basically means:
- Create a 'bag' of questions (using an array),
- Randomize the order of questions in the array
- Choose one of them, and
- Pull that question out of the bag so it doesn't appear again.

Now, since Storyline does not support array variables, you need to use a text var as a placeholder and then fire up a JS trigger that does the whole conversion there.

The example I'm attaching does this. The only thing you need to do is map the 'selection' var values to each question slide and route to them, depending on your setup.

Let me know if you have any questions.

Hope this helps,

James Grayson

Hi Alex,

The wonders and mysteries of javascript... Thanks a lot for this idea, it looks really promising. The "solution" I came up with was to give each player a game-card (like a bingo card) with 20 shuffled shapes on it, each one linked to a separate question layer. Your way looks like it should work a lot more smoothly.



Alexandros Anoyatis

When I first encountered this issue, I too was using Random Quiz Banks of 10 questions, which had to be revisited three times. Since I didn't want the same questions to appear, I just copied the entire quiz bank twice more and pointed there instead. That bloated the story with redundant content, so I do feel your pain.

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