Skip to content

How to Calculate Sum of Numeric Entries in Articulate Storyline

Articulate Storyline is a versatile e-learning courseware authoring tool that allows learning designers and developers meet creative learning requirements that go a long way in engaging learners and making learning impactful. It also eases the task of developing custom solutions through the use of Triggers and Variables.

 In this post, I would like to share one unique requirement we customized for our client.

We were asked to add the values in all the numeric entry fields in a slide whenever a learner clicks the Add button.

For example, if there are 4 sections in a class, we need to add the number of students in each section and calculate the total number of students. The learner should be able to enter the value for each section dynamically.

Here is how we met the above requirement. (Please note that Articulate Storyline provides 2 data entry fields – Text entry and Numeric entry.)

Step 1: Create a new slide and insert a numeric entry field for each section in a class (example screenshot given below).

Create a new slide and insert a numeric entry field

Step 2: In Storyline, for numeric entry fields, a variable is created by default and initialized to the typed value. Here we create 4 variables: NumericEntry, NumericEntry1, NumericEntry2, and NumericEntry3. 

Default variable is created

Set variable

Step 3: Insert an Add button to the slide.

Insert an add button to the slide

Step 4: Create a number variable TotalStudents with initial value ‘0’.

Create a number variable total students

Step 5: Add the triggers given below to the Add button in the same sequence.

Trigger 1: Adjust the value of the variable TotalStudents to ‘0’ when the learner clicks the Add button. 

Adjust the value of the variable total students

Trigger 2: Add the value in the variable NumericEntry to TotalStudents when the learner clicks the Add button. 

Add the value in the variable

Trigger 3: Add the value in the variable NumericEntry1 value to TotalStudents when the learner clicks the Add button.

Repeat this Trigger for the remaining variables – NumericEntry2 and NumericEntry3. 

Add the value and repeat the trigger for 3 other variables

Add the value and repeat the trigger for 3 other variables 2

Add the value and repeat the trigger for 3 other variables 3

Step 6: Insert the variable TotalStudents between two percentage symbols in a text field to print the total students in the class.

Insert the variable total students

Publish or preview the course and see the output

Publish or preview the course and see the output.

In this way, we can calculate the sum of numeric entries in Articulate Storyline. Hope you found this post useful. Do share your thoughts.

Authoring Tool Finder - Find the Best Suited Authoring Tool for Your Needs