top of page

Programming tips: Objective IDs in Articulate Storyline


In recent weeks, we were faced with a challenge from one of our clients, here at Pathways Training and eLearning, to report several scores from just one eLearning module. Let me give you some context on what we were developing.

For this project, we were tasked to create several different tests within one Storyline file, to which the users would have access via a menu on the first slide. While this is simple to do, the most challenging part was to report to the LMS, the score from each one of these tests.

After some research, we found out that this was possible by reporting different objective IDs, but how were we going to achieve this? Was this an LMS configuration or a custom programming inside our eLearning module?

Believe it or not, this is achieved through a custom programming inside Storyline by the use of Javascript, since the LMS is simply a recipient that shows us the information we want it to show.

Let’s remember that Storyline comes by default with a Javascript API that lets us communicate with the LMS to send and receive different kinds of information, like the learner’s name, learner’s progression on the eLearning activity, etc. So, to report more than one score to the LMS under different objective IDs, it’s important to first create a results slide to track the score of the corresponding test, and then create a trigger to execute a Javascript code when timeline starts:


Then let’s add the following code to the trigger:

var lmsAPI = parent;

var player = GetPlayer();

var test_result = player.GetVar('test1_result');

lmsAPI.SetObjectiveScore('objectiveID_1', test_result, '100', '0');

Note: It is important to know that, we cannot access directly the results variables that Storyline creates with each results slide, so we need a custom variable (in this case, “test1_result”) and then, before we execute the JavaScript trigger, we create a trigger that assigns the results variable to the custom variable.

This is how the code above works:

  • The variable lmsAPI, is retrieving from the SCORM package, the JavaScript API that will let us communicate with the LMS.

  • The variable player, retrieves the Storyline player that contains all the information we need to send to the LMS.

  • The test_result variable retrieves and contains the score percentage that was calculated with the results slide.

  • And the last line, is simply reporting to the LMS, the score percentage under the objective ID “objectiveID_1”, that should be in the range between 0 and 100.

After this, you should be able to report as many scores as you want to your LMS.

If you want to know more about eLearning, please visit our website at www.pathwaystrainingandelearning.ca.

Featured Posts
Recent Posts
Archive
Search By Tags
Follow Us
  • Facebook Basic Square
  • Twitter Basic Square
  • Google+ Basic Square
bottom of page