Forum Discussion
Simulating code development in Storyline
Thanks, Math!
I created another design that does not use JavaScript. The issue was that the instructions said to create a code block that had multiple lines of code. Because Storyline evaluates the entry when the text entry field loses focus, the user couldn't enter more than one line of code on a slide without clicking off the text entry box to get Storyline to evaluate the entry.
I used a combination of freeform slides and plain slides that had text entry fields. Each slide is for one line of code. I added a Return shape on the slide that looks like a keyboard key. On the freeform slides, I changed the default Submit Button under Field to evaluate to the Return shape. The instructions tell the user to click the Return shape to create each line of code, but it's actually serving the purpose of removing focus from the text entry field. On the plain slides, having the user click the Return button ensures that the field loses focus (they could actually click anywhere on the slide to get this to happen).
On the freeform slides I set the feedback layers to hide when the timeline starts. I set Attempts to Unlimited.
Storyline evaluates each line of code before moving to the next slide, but the slide transitions are not apparent to the user. Nothing appears to change until they type the code correctly. When they type the correct entry, Storyline moves to the next slide, which shows the line they just typed and a new text entry field for the next line.
Because the user doesn't need to create another line of code at the end, I used a freeform text entry slide with the default settings. On this slide, the user can press their Enter key to have Storyline evaluate the entry.