Clicking button only changes variable once then stops working

May 30, 2019

I have hit a wall with something that should be incredibly simple but doesn't seem possible.  I have a variable, TaskB1, that I want to eventually contain different text values throughout the course. At the beginning, I want users to be able to set a value of Yes or blank to it by clicking a button.  So, I create two triggers for the button:

- Set TaskB1 equal to Yes when the user clicks the button if TaskB1 = [blank]
- Set TaskB2 equal to [blank] when the user clicks the button if TaskB1 = Yes

VERY straightforward, right? When I click the button the first time, TaskB1 should be set to "yes." If the user then changes their mind they should again be able to click the button to change the value back to [blank].  However, it doesn't work. The order of the triggers shouldn't matter, they should both be evaluated and execute every time the user clicks the button.

Can someone please tell me what I'm doing wrong or (more likely) this is a bug? It is preventing me from creating a course where simple logic should work.

4 Replies
David Schwartz

Hi Noel,

The problem you hit, and I've done it myself a bunch of times, is that the variable gets changed in both triggers. First time through, only the 2nd trigger's condition is met, but after that, the 1st trigger's condition is met, and then because the variable gets changed, the 2nd trigger's condition is also met, and the variable changes right back.

I added a T/F variable and another trigger that toggles that variable each time the user clicks. Then I changed the existing triggers to add a condition that each only goes if the T/F variable is set correctly. This way, only one of the original triggers will succeed with each click.

 

 

Noel Estabrook

Thanks, Dave, though I'm not sure if I'm following your logic.  Here was my grand plan when I first started this out.

At the beginning of the course, learners would decide (yes/no) whether they thought a given task was important (my original problem).  Later on in the course, however, they would take those items they said "yes" to and then decide if they were VERY important, somewhat important, or not really that important (big/little/least), so my variable would be yes/no for a while, and then be given values that would allow further information based on their value.

How exactly would a 2nd True/False trigger help me?  I am going to have 12 of these tasks/variables.  Are you saying that each task will have both a T/F and a Text variable assigned to it and that I need to do something to the T/F variable every time I set the value of the Text variable? I am just trying to think through how the logic of that would even work without me running into the same issue.

 

David Schwartz

Noel,

Glad it's working. I understand your frustration, but I think in the long run it's better than these triggers work in series, so you can have multiple actions occur based on a single condition or set of conditions.  One situation where it does what you are talking about is when you have a trigger that jumps to another slide. That prevents the remaining triggers on the original slide from launching.

In this current situation, though, the 2nd T/F variable is really used to prevent both of your triggers from being activated, while still preserving the functionality. If you had just needed a simple T/F variable, the toggle trigger would be the only one you need.

 

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