Drawing a random number

Hi,

We wish to draw a "random" a number - this is for a synchronic session.

It can be a roulette, a bingo - anything in which we can draw 20-30 random numbers.  

Do you such a solution? Template? Even a PPT designed for it?

It can even be a PPT that in each slide a specific number is always "chosen", they don't know that it is not a game..

 

Thanks!

Efrat

3 Replies
Alexandros Anoyatis

Hi Efrat,

If this is for Storyline (and if I understood your question) there are two ways you can do that.

You can generate a random number from within Storyline by means of a Javascript trigger. You can review the last section in this article for instructions on how to do this.

Or (in some cases) you can assign a quiz bank to the slides you want randomized.

You can also refer to my replies in this post if you need to pull random numbers out of a subset once, then redraw out of the remaining one's.

Hope this helps,
Alex

John Nixdorf

Like Alexandros mentioned above, you can use javascript to generate a random number. An application of this is shown in the attached Storyline file. Regrettably I haven't found any way to manipulate states of objects directly from javascript (hello Storyline Development Team, are you listening?) so I had to have a trigger for each 8-ball answer.

You'll find the javascript in the trigger for the 8-ball image way at the bottom of the triggers panel. Here's the javascript:

//Links javascript to Storyline player
 var player = GetPlayer();

//Creates a variable "randomnumber" and sets it equal to an integer
//value between 1 and 10

var randomnumber = Math.floor((Math.random()*10)+1);

//Creates a variable "oldrand" pulls the current value of "randnum" from
//Storyline, and sets the value of oldrand equal to the current value of
//randnum.

var oldrand = player.GetVar("randnum");

//Tests whether the new value of randomnumber = the old value of
// randnum. If it is, it sets the value of randomnumber to 11. This insures
//that if the value of randomnumber generated in this cycle of this script
//is equal to the value of randomnumber generated in the previous cycle
//of this script, the value of random number is set to a value that cannot
//be equal to the previous value (since the random number function only
//generates number between 1 and 10. This keeps the same state of the
//8 ball from appearing twice in a row

if (randomnumber === oldrand )
  {randomnumber = 11;}

//pushes the new value of randomnumber to the Storyline Player
//variable randnum

 player.SetVar("randnum",randomnumber);