Having an automatic "Question X of Y" counter

I built this after asking this question: http://community.articulate.com/forums/p/16923/96126.aspx#96126

Having a running total of how many questions are left is something useful to have, it can really give your learner a "light at the end of the tunnel" instead of them going "oh god another question, I have no idea when this ends someone shoot me."

Storyline lacks an innate ability to do this, so in the meantime, I came up with a fix that will automatically calculate total slide count, and should convienently count up on question slides. It's a little complicated, only counts question slides, and only works right if your questions are worth the same point value. (Though you can fudge the last two.)

But it seems pretty reliable, and since we're using it as part of a template we're going to get a lot of milage out of it. And maybe it'll help somebody! Here's what I'm doing:

Step 1:

On slide 1, create triggers to run when the slide starts: Set a variable called TotalSlideCount to the value of Results.PassPoints, Set a variable called PassingScore to the value of Results.PassPercent, and a third trigger to execute Javascript code.

Step 2:

Open up the javascript window, and paste in the following code: (You can leave the comments in.)

var extras = 0; //change this to sneak the total higher or lower.

var player = GetPlayer();

var percent = player.GetVar("PassingScore") / 100;

var slidecount = player.GetVar("TotalSlideCount") / 10; //Change to what your questions are worth.

slidecount = (slidecount / percent ) + extras;

player.SetVar("TotalSlideCount",slidecount);

If you're not used to looking at javascript (it's super-scary and frankly I'm new too so suggestions are very welcome), what this code does is it pulls how many points you need to pass, what percent you need to pass, and how much each question is worth...and does some elementary school math to figure out how many question slides you have! Then it sticks that result in the Storyline variable TotalSlideCount.

Note the first and fourth steps. That first one, you can change that 0 to a 2 or -1 or something if this script is coming out a bit too high or low for you. Like if you have a question slide that isn't scored or counts double or something, change that number.

On the fourth step, change that 10 to whatever your slides are worth in points. If you left them all as the default ten points, then you don't need to worry!

Step 3:

go to your master slides and figure out which one(s) your question slides use. on these, add a little box with "%SlideCount% of %TotalSlideCount%" in the corner or someplace you think is cute. Also add a trigger that runs when the slide starts, that causes a variable named SlideCount to go up by one.

That's about it! Your show should now have an automatic tally running on every question slide, letting your learner know how much they have left to do. And as you add or remove question slides, you don't have to keep going back and tweaking things!

Hopefully this helps someone. If you're fighting with it, ask me questions and I'll answer or put together a demo project.

5 Replies
Lesley Cashman-Peck

Hi Brett - I was not successful in having the java calculate the TotalSlideCount. Bummer!  I have no idea where I went wrong, but I did want to point out that the counter works great EXCEPT if you have the option to review the quiz.  In quiz-review mode, the counter continues to count such that ques one becomes one up from your last question and so on. Know of a variable to control this?  Wish there was just a simple, ques x of y option!!