Random number sequence?

Feb 24, 2022

I would like to present a series of 30 images in a random sequence. So, each time the course is started, or the interaction is re-started, the images appear in a different sequence.

I do not want to see the same image twice in any 'run' of the sequence.

Does anyone know if  this is possible and if so, how?  I seem to remember it was possible in Flash, so perhaps there is a JavaScript way of doing this?

Many thanks in anticipation...

5 Replies
Tracy Parish

Here is a quick way to do this. 

  1. Add your first image to the page. 
  2. Add various states to it (I did 1 to 10). 
  3. For each state, edit the image to a different picture (for consistency you might want them to be all the same size/aspect ratio). 
  4. Then create a random number variable. 
  5. Create a trigger that changes that variable when the slide starts.
  6. Create another set of triggers that change the state of the initial image to one of the states you have created if/when it equals random number X.

    See attached file.

    This is just one possible solution to this idea.
Martin dean

First of all, WOW!  Thank you for your response and for being so quick!  I really appreciate it.

When I tried your file, I did get several 'repeats', which is of course the whole point of 'random'.

What I was hoping for was a way to randomise a sequence of numbers from 1-10 and then to use that sequence as a 'playlist' for my images.  the 'states' approach would be great for this but the repetition would not happen.

Then, when the slide is re-visited, the sequence is re-randomised and the user sees the images in a different sequence,  (I think this is what Apple Music does when you 'shuffle').

I appreciate you probs have better things to do, but if you have any ideas, I would be very grateful.

M

Ron Price

Tracy's suggestions are great (as usual).  If you want to make sure the same picture does not repeat, it may be a little tricky.  If that is the case, you may want your pictures on layers -and you may want a TF Variable for each layer that sets to true.

Then you can use a trigger to show the next layer if it is true.  This may sound a little complicated, but here is a link to a similar example - https://360.articulate.com/review/content/da5b64f6-7694-4321-91cc-1a46159a4f0a/review

We did this a couple of years ago during our annual meeting.  All of our team members submitted a favorite "tip" - their "one thing" they go to.  We wanted each to show randomly, then that team member would discuss or explain. And we did not want any to repeat.  

Select the text "One thing to rule them all" to start the game . . . and just click anywhere on the tips to close them.