Practical uses for JavaScript in Storyline
The following sections will teach you how JavaScript works in Storyline.
Generating a word count
Word count calculators are a great way of ensuring that your learners aren't creating too much work for you when it comes to evaluating short or long answer responses. By specifying a word count, you can guide your learners to the desired length of response you expect to receive.
In Storyline, you can use variables and JavaScript to easily create a word count calculator.
Exercise 5
Let's take a look at Exercise 5. In this exercise, you will learn how to use text and number variables, in collaboration with JavaScript, to create a word count calculator. Please note that in your Manage Project Variables panel, you will notice additional variables; these variables are associated with the After example and will have the prefix AFTER. For ease of use, download JavaScript1.txt
and copy/paste the script into the Storyline Script field.
In your exercise scene, you...