Tracking the number of slides on LMS

Jan 22, 2015

Hello everyone,

I have a challenging requirement from my client, he wants to see that how many number of slides has been viewed out of total on LMS. But as where as I know LMS only shows the completion percentage!

 

Kindly give your valuable suggestions!

 

Best regards,

Sahil Mehta

 

11 Replies
Steve Flowers

SCORM doesn't have a data element for "slides viewed". Using the SCORM data model, one of the ways you could do this is using a score %. You'd need to use some custom JavaScript and additional triggers to get this done. 

Off the top of my head:

  • Create a set of variables to hold your "slides viewed" tally, the current slide value, and the total number of slides. masteryArray, cSlide, and tSlides in the example below.
  • Create a trigger on each slide to change a current slide variable (ex, cSlide) to the number of the current slide (1, 2, 3, 4, 5, 6)
  • Create a trigger on your master slide to execute a JavaScript trigger whenever cSlide changes.
  • In this trigger, grab the value of cSlide and change an array index to 1 when that slide is visited. Converted to a string, for example if masteryArray was 0,1,1,1,0,1 then slides 1, 2, 3, and 5 would be visited. (the first slot is always going to be 0 in this example since the index address is 0)
  • Also in this trigger, calculate the sum of the array. In the example above, the total would be 4. 
  • Also in this trigger, run the calculation for the total number completed by grabbing the sum and dividing by the value of tSlides. If the total number of slides was 12, the completion would be 25%. 
  • Use the LMS API to submit the score to the LMS. 

So when all is said and done, the LMS will get a score report every time a new slide is visited. Some LMS may not like this as they could close off additional reporting once the score has been set. 

Steve Flowers

Here's a quick example of what the JS trigger might look like.

var player=GetPlayer();

//grab the array so we can update it
var masteryArray=player.GetVar("masteryArray").split(",");

//grab the current slide number
var cIndex=player.GetVar("cSlide");

//set the array index of the current slide number to 1
masteryArray[Number(cIndex)]=1;

//push it back into storyline. Need to retain it so we can update it
var collapsedArray=masteryArray.toString();
player.SetVar("masteryArray",collapsedArray);

//calculate the sum of the array
for (var i = 0, sum = 0; i < masteryArray.length; sum += Number(masteryArray[i++]));

//grab the total number of slides and calculate the percentage complete
var tSlides=player.GetVar("tSlides");
var totalComplete=Math.round(sum/Number(tSlides)*100);

//submit to the LMS
var lmsAPI = parent;
lmsAPI.SetScore(totalComplete, 100, 0);

 

Cat Williamson

Hi Steve Flowers,

I know this is a really old post. I got a variation of this script to work, although not perfectly, in Articulate TempShare but I have not been able to get it to work in SCORMCloud or Moodle.

In Articulate TempShare, it will work unless a skip a slide when I will temporarily have a problem with the array index that I missed. It does not seem to insert a zero.

In SCORMCoud and Moodle, I can't get past the first slide. Any ideas? I would appreciate your assistance.

I'm using Storyline 3