Random Character Generation in Articulate

Hi all, I'm a total newb - just downloaded the app yesterday. 

How do I create a random character generation field and a typing window on one slide?

On one slide I need to place a field where random characters show up upon loading and when a button is pressed. Below that is a typing window where the user would type in what was generated in the field above. Kind of like a Captcha, only they get rewards for typing in correct characters. 

22 Replies
Glenn Jones

Hi Kelly

Not sure here, but I think you'll need to add some JavaScript to generate the random letter.

There's information on using JavaScript on this page http://www.articulate.com/support/storyline/javascript-best-practices-and-examples but I don't know how you'd generate a random letter.

Once you've actually generated the letter within JS, you can pass it back to the eLearning as a variable value and then do all you need to do in terms of rewards.

Hope that helps.

Matthew Bibby

Hi Kelly,

Give this a try:

  • Create a text variable in Storyline called random 
  • Add an execute JavaScript trigger to your button with the following code:
var randomstring = Math.random().toString(36).substring(7);
var player = GetPlayer();
player.SetVar("random",randomstring);

See published example here (link valid for 10 days) and the story file is attached.

Let me know if you have any questions.

Kelly Parke
Leslie McKerchie

Hi Kelly!

Looks like you are getting some great assistance here :)

Yep, so grateful to you all! Can't wait to try all the suggestions tomorrow. Right now I'm creating all the artwork and backgrounds for this project - about 4 states for each of 6 slides. Ambitious? lol

Kelly Parke
Matthew Bibby

Feel free to reach out if you run into any trouble implementing this Kelly - happy to help.

Thanks Matthew! I'll be in my lab tomorrow putting this together tomorrow morning and probably well into the afternoon. I'm still creating artwork and my story boards. I'll be up late finishing those. 

I do have one question: will Storyline import vector .ai files ( native Adobe Illustrator) or a standard vector .eps? Also, what is your experience with native .psd's (Adobe Photoshop)? Will I need a path around the image if it's a .tif or shall I go with .svg for all images?

I created everything (except an army robot) in vector, so I'm hoping .svg is an option.

Kelly Parke

Thanks Matthew, that bit of info saved me many woes - thank you. I'm sitting here at work just finishing up the 4th layer on slide 1, lol, only 15 more slides to go - and I haven't implemented dynamic code yet - that's not for another 8 slides. I'm guessing that I'll be here for a while, will you be around this evening?

Leslie McKerchie

Hi Kelly!

Here is some information about publishing and sharing your content:

If you view an Articulate Storyline course on your local hard drive (or send it to someone else to view on their local hard drive), you'll encounter security restrictions from the computer, web browser, Flash Player, and network that'll cause various features to fail. To properly test your published content and share it with others, upload it to the environment for which it was published. See this article for details.

Kelly Parke

There is an option to post it to my account, but it failed. I've since emailed the zip file to the prospective employer who gave me a week to learn this new program and create a module with no less than 5 slides and 3 quiz questions. I also sent him a 19-slide storyboard so he can see what I will hopefully finish in the next couple of weeks during this free trial.

Because I got to pick the topic, I decided to develop an interactive presentation of a program I created for the school I teach at (k-6 charter school. Two birds with one stone! Ha!

Leslie - I didn't have a problem with local files publishing the story.html file or the zipped file, only problem I had was the option to publish on the articulate website under my profile. The help file said it was supposed to have a domain like parkecreative.articulate. something, something.... ugh, I'm at home now and left documentation in my lab. My account username and password were fine, it was the url; couldn't find help for that. Didn't even know I HAD A URL! So much to learn, lol.

Thanks everyone for helping me get through this. It's been a very long weekend and it's going to be an extra long day since I just got back home with no sleep (my alarm goes off in 1-1/2 hours, lol. *yawn* might grab some cereal and snooze for an hour. 

See ya on the other side!