Variables and Same Scene

Nov 29, 2012

We have a course where the participant is asked to review some forms. By identifying errors, they learn how to complete the form. Once they click a field, the state changes color and the variable adds to a variable called error. This appears on the screen so the user knows how many errors they have found.

We are running into two problems. The first is we have three of these forms in one scene. When the participant finds the errors in one example, that total appears on the next example. We need to have the total errors reset to zero for each example. I have already tried to set the When revisiting to all the options, but that does not help this issue. The totoal for one example carries over into the toal for the next slide/example.

The second problem is if the participant clicks the same field more than once it keeps adding to the toal number of errors. How do we disable the variable once the participant has selected it?

Thanks for the help.

3 Replies
Mike Enders

Jeffrey,

Two options for your first question...

1. You could simply have 3 discrete "error" variables.  One for each form.  Or...an easier approach...

2. When the new slide (with the next form) appears, have a trigger on that slide that adjusts the error variable back to 0 when the timeline starts.  

As for issue #2, let's say that your click area (field) is a transparent object.  You can add a second trigger that says change the state of the object to hidden once the user clicks it.  This would then disable the ability for the user to keep clicking the same object and increase the variable count.

I hope this helps!

Mike

Kevin Thorn

Hey Jeffrey,

If I understand correctly, there's a simple fix for both of your issues.

First, setting a slide to initial state when revisiting does indeed reset the slide, but it does not reset variables. When using the same variable across slides for different interactions, the simplest way is to create a Player Trigger on each slide you want the variable to reset as: Adjust Variable [error] =Assigment [set to default value] When Timeline Starts. Essentially what's happening is you're setting the variable back to its original value as if it were never used before.

For your issue with users clicking the same field twice, there may be a few options here:

1. Create a separate variable for each field. 'error1', 'error2' etc. Then use =Assigment 1.00 for each one clicked. To total all the clicks, create another variable 'ErrorTotal' and +Add each of the 'error1' 'error2' variables to it. A bit more work but keeps things nice and tidy.

2. Depending on your design and whether or not you want users to have the ability to click on a field more than once, you could create a transparent shape set initially to Hidden that's directly over the clickable field region. When the user selects that field, change the state of that shape to Normal. This will prevent any further ability to click that field.

3. Create separate variables as in #1 above. This time set them as T/F variables set to False initially. Set the trigger to change the variable to True when a user clicks. From there the user can click all day long and it won't go back to False. Again, create an 'ErrorTotal' numeric variable to tally the results. Finally, add a few triggers to the Submit/Next button such as: If 'error1' is equal to True, +Add 1.00 to 'ErrorTotal'

As they say, "There's more than one way to skin an onion."

Good luck and hope that helps.

Jeffrey Riley

Thanks Mike and Kevin for the quick and helpful answers. I ended up using Mike's answers as they worked fine and were the simplest.

I set a trigger on each slide to reset the value to 0. That was easy to do and I was able to just copy that trigger to all the other slides.

It took more time to add a disabled state to the fields and paste in that trigger but that stopped the user from clicking more than once.

Everything works well and thanks again.

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