How do I count hotspots?

May 02, 2013


I've not used variables before can someone help me with the following; here's what I need to do

A learner clicks each of 5 hotspots

A box displays a count of how many out of the 5 have been found

A message appears once all 5 have been found

Muchly appreciated

8 Replies
Phil Mayor

I wouldn't use hot spots as they can be counted again.  Use transparent shapes with a custom state (counted).

Add a variable number called Count.

On each transparent shape add a trigger to adjust variable count and add 1 on condition state is not equal to counted.

add a second trigger to change the state to counted

Add the triggers in that order this way they can only be counted once

Rebecca Fleisch Cordeiro

Hey Phil,

How clever to to add the triggers in this way so, as you say, they can only be counted once (rather than needing to add extra triggers to subtract). Question: is there a reason you've suggested that Shona create a new "count" state rather than using the visited state in the same sequence?  And adding triggers in that order? I'm sure you have a reason, but I can't figure out what it is. Thanks!

Phil Mayor

Hi Rebecca

I worry with visited that it changes before the triggers fire, I did initially go with visited (started typing visited and then change my initial post) and never demo'd it.  If it works off visited then you need one less trigger.  I was stuck for time this morning and didnt want to troubleshoot it if it didnt work.

Rebecca Fleisch Cordeiro

Hi Phil,

Tx for your reply. I do become bedfuddled sometimes over the firing of the visited state. Anyway, had a chance to go back and try it out, and it seems it DOES work in this instance, and as you said, you can get away with one less trigger.

And I gather the reason is:

SL "knows" about the visited state, it's pre-coded (probably not the right word) and so you don't need to tell it to "change the state to visited when the Learner clicks"...happens automatically,

So, all you need is the add 1 when the user clicks if the state is not equal to...

Love saving triggers. If only I could remember all these tips and tricks when I need them!

This discussion is closed. You can start a new discussion or contact Articulate Support.