Bug with copying actions that modify variables

zliquorman1276 Community Member Posts: 67 ☆ Roadie ☆
For those who have encountered a similar issue and just want the fix, scroll down to "Solution":


Running Lectora 17.1.3

I had a slide where I had a set of 3 buttons, and after all three were clicked, would cause a new text box to appear. I had set it up where each button triggered an action onClick to modify a single variable. Originally, I tried a simple setup where clicking a button would add "1" to a variable "text_show" (with an initial val=0). Clicking each button also triggered an action to show the hidden text box with the condition "if var text_show = 3". So, what was supposed to happen was that clicking each button would add 1 to the variable, then the second action under each button object functioned as a check to see if the variable value was 3 yet (and if not, leave the text hidden).


What ended up happening was that clicking any of the buttons would cause the text to appear.


After checking my modify variable actions and condition statements,  I decided to try it a little different, to try and maybe isolate the cause of the issue. So I changed it so that instead of each button click adding a value to a single variable, each button click modified a new variable (one for each button). So clicking Button1 triggered an action to modify the variable "show1" by adding the value "button1". Button2 would trigger modification of "show2" to add the value "button2", etc. The "check" action now had 3 conditions (and set to "all must be true"), with the first condition being "show1" must equal "button1", the second condition "show2" must equal "button2", etc.

Again, the same issue though. Clicking only one button caused the hidden text to appear prematurely. So now, to further troubleshoot, I added a new text box on a blank space, and set an action that triggered on pageShow to modify the contents of the text box with the values of each of the 3 variables: VAR(show1) VAR(show2) VAR(show3)

So now, on clicking a single button, the text changed to show "button1 button2 button3" after clicking only one button, confirming what the issue was. But I was still at a loss as to what caused it.


I decided to try something on a whim. I had previously created the first modify variable action, then copied and pasted it to the next two buttons and modified their details. So, I deleted the actions modifying the variables, and made them each one by one instead of copying the first one to the next two and then modifying them.

And wouldn't you know it, that fixed it. Bizzare issue that hopefully Trivantis is aware of and is fixing. For now, I guess just avoid copying triggers that modify variables.