Random Number Generator

Feb 20, 2023

Please help! Is there a way to set up a bank of random numbers inside my Storyline?  I need to randomly generate 100 unique numbers.  After the learner completes a course, they would click on "generate a secret code" and it would access the bank of random numbers and present them with one. The numbers have to include numbers and a cute phrase such as: 8271BunniesRcute and dogsRgreat3719. I've read through a ton of threads but I can't find anything with a number bank. 

We don't have an LMS so we're going to set this up so that the learner can give us their "secret code" then we can record them as having completed the module.

I'm also open to any other ideas for tracking course completion without an LMS. We want it to be something fun. :)

Thanks!

18 Replies
Steven Benassi

Hi Darlene!

Great question! I have mostly only seen solutions to generate a random number using Javascript as there is no built-in functionality for Storyline, but this one does use a question bank so it might work for you as well.

Also, I found this resource that explains how to assign a random value to a number variable using triggers.

Hope this helps!

Tom Kuhlmann

You can generate a random number using variables. That's easy enough. You'd probably have to create a random series of text that is connected to a random number. Of course, the code could be anything since it's not really connected to an account.

Here's a training video David did on using number variables.

If you did use a random generator, I'd not use 100 characters as that requires a lot more work.

Here's a post I did a while back that may interest you.

https://blogs.articulate.com/rapid-elearning/simple-way-track-courses-without-lms/

Boon Heng Goh

Hi, I am new to Storyline and just downloaded the 30 days trial. I was trying to add a Random number to my project. I see that in some of the examples above, when one creates a variable, it is possible to set it to some Random Number between X and Y. However, in my version of Storyline, I can only set a Variable to a value or a variable. There is no Random Number option. May I ask if this is because my version is the trial version? or am I missing some steps or setup for this to work?

Nedim Ramic

You would normally create another custom number variable for which you are setting the random number value. In the screenshot, I have created a number variable named "myNum," which I am setting to a random value between 1 and 10. Keep in mind that "Random" is a built-in selector and it only works with number variables. The random number between will automatically appear after Random is selected. This should work with the trial version as well.