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.
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
3 Replies
Hi Efrat,
Have you checked out Random.org? I cool site that creates random numbers based on space noise of all things.... geeky but cool!
If I remember correctly, they used to have a simple code you could embed that would link to their generator.
Hope this helps!
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
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);
This discussion is closed. You can start a new discussion or contact Articulate Support.