Assessing Text Entry data fields

Apr 27, 2023

Hello everyone, 

Does anyone know of a way to "grade" text entry fields that don't have one specific answer but rather, open ended criteria?

What I am trying to do is create an IT training about passwords.  One of the objectives is to be able to create a "strong password." I was hoping to create a text field where the learner could enter their "strong password" and Storyline would be able to "grade" it, looking for capital and lowercase letters, at least one number and the use of 12 characters or more. Maybe I'm dreaming but I thought it would make for a cool interaction.

Any ideas would be appreciated! 

TIA

3 Replies
Ange CM

Hi Kaylee, It is probably possible with legions of triggers, variables and conditions... .  Although inserting javascript in SL would be a more elegant and workable solution.

This page has examples of javacript needed, ignore the .css   There are many others.
https://w3collective.com/password-strength-javascript/
I am not a javascript expert so I can't offer the exact code etc. you would need to make it work, and make it work in Articulate.. There are a number of sites you can test your javascript, if not working correctly, the errors are highlighted so you learn and understand why the errors.

There are also some javascript experts in this forum, and many online sites, who may be able to help you out if you go that route.

Mike Enders

Hi Kaylee,

First, I'll preface the following with "I have ZERO Javascript knowledge". However, I have been curious about whether something like ChatGPT could help me accomplish things in Storyline that were previously beyond my ability. Your question was a great opportunity to test it out!

I asked ChatGPT to generate javascript code for Storyline that would assess a text string and then assign points based upon length of the string (1 point for 1-2 characters, 2 points for 3-4, etc.). I then also asked it to add a point for the presence of a symbol and another point for the presence of a Capital letter. 

And...the code didn't work. 

I had to do a little sleuthing and discovered that ChatGPT wasn't quite following Articulate's recommended best practices for javascript. As I stared at the code I noticed, for example, that ChatGPT's initial code was using something called SetVar. However, Articulate's best practice page says to use player.SetVar. So I copied that paragraph from Articulate's best practice page and asked ChatGPT to alter the code based upon that paragraph. 

And...the code still didn't work. But, I was closer!

I started looking at other examples of javascript code. For example, Zsolt Olah has shared this wonderful course on Javascript in Storyline. 

As I looked at Zsolt's examples, I noticed that many of his code snippets started with var player = GetPlayer();

ChatGPT hadn't put that in its code for me. So I said "Hey, ChatGPT I think we need this code at the start" and ChatGPT responded "You are correct, we do". So the code was added and...

It worked!

I've created a quick mockup in Storyline for you and am attaching it here. Password assessment is likely more nuanced than this and you'll probably want to adjust it, but I think it's a fun proof of concept and hopefully a good starting point for you!

Mike