Is there a way to randomly select a scene?

Jul 18, 2022

I have a course where I've created a content scene, and then I have a number of scenes that are setup as scenarios to test the learner's knowledge.  The course is recurring training, so I'd like to randomize the scenario scenes so that learners aren't seeing the same one every time they take the course.  

So, is there any way to setup a trigger to jump to a random scene?  

Thanks in advance for the help.

v/r

Jay

12 Replies
Judy Nollet

There's no trigger for jumping to a random scene. 

Here's an option that might work: 

  • Put the first part of each scenario on a question slide in a Question Bank (QB). 
  • Insert a draw from the QB that randomly picks one slide. 
  • Adjust the QB slides so they jump to the appropriate scene to continue the scenario. 

Here are some User Guide entries that might help: 

Jay Cooper

Thank you sir!  

Like I said before...I need to brush up on my JS as it's been awhile.  The rest of what I need to do is assign the three random numbers to three variables within Storyline.  

In the script you sent, what is ([...nums]);?  Is that identifying the values within the set as numbers?  

 

Math Notermans

Yes an array with the 3 random numbers in it. I set it to 1 variable now...you can easily assign the 3 values to 3 separate variables.
Added it to the sample now.
Basically this is how you get a specific value from a Set.
player.SetVar("val1",[...nums.values()][0]);

Updated in the sample and here is the Storyline.

Sets have the specific quality that they never can have duplicate values in it. Only unique values allowed.