I'm having a problem with a variable not incrementing properly when using Tab and Enter (for 508 compliance) to navigate through a page. The page in an interaction where the user has to select multiple items and then click a Submit button to get it correct. After the first incorrect try they get one feedback and after the second incorrect they get a different feedback box appearing. Everything works fine when using the mouse or the shortcut keys I defined for the input. The problem arises when the user uses the tab and enter key combination. If they get it right on the first try, everything works as it should. However, if they get it wrong, it immediately shows the second feedback option.
I'm using a variable to count the incorrect. I've tried the increment (increase by 1) and expression (var = var + 1) but neither seem to make a difference with the tab/enter method. Have any of you had this issue and know how to deal with it?
To debug this you will need to be able to get a better handle on where it is failing.
Insert a Smart Shape somewhere on the slide and insert the variable into that shape (timed for rest of slide) so that you can always see the variable's current value. Then publish and test the interaction slide again. You should then be able to see where the variable is or is not being incremented.
You may find that there is a point where the increment action is NOT being executed as expected.
I did that and when using the tab/enter combination it goes straight from 0 to 2. Using the defined keyboard shortcuts and mouse it goes from 0 to 1 and then to 2 on the second error.
My thought is perhaps clicking the enter key does something, but I can't find where or why that's happening.
Seems to me like it's executing the increment action twice. Once for Tab and once for Enter. What happens if you don't use Tab and just use your mouse to get to the next TEB? Does it then increment once?
Thanks for the suggestion. I tried this and have isolated the issue to using Enter on the submit button. That's when the variable increments by two. It actually seems to run the Now I just have to figure out why that's happening and how to fix it or a workaround.
That is really weird. Did you check the Advanced Interaction panel?
Is this slide a quiz slide or just a normal slide with interactive objects?
The interaction panel shows infinite attempts, run advanced action on success, continue on failure, and S for the shortcut (although for 508 compliance I also need the Enter key to work).
This is a normal slide with objects that I created. (slide shown below)
The advanced action is below. It works fine with everything except the Enter key. If anyone can think of another way to accomplish the same task, I'm willing to try anything at this point.
What shortcut keys are used to set a choice as selected? Are you possibly using ENTER for them and for the submit button?
My user-defined shortcuts are to use the letter of each option (a, b, c, d) and s for the select button.
OK, so can I assume you set the default value of vIncorrectCount to 0 in the variable setup OR as an On Enter action?
Then, the user types a,TAB, b, TAB, c, TAB, d to select the choices.
Then TAB to get to the Submit button.
Or, is it a, s, TAB, b,s, TAB, etc. to select those options and move to the next?
In any case, after the last TAB to get to the SUBMIT button and following Rod's suggestion to display the variable value, does vIncorrectCount stay 0 up to this point?
Then the shortcut to fire the Submit button is ENTER?
Please let us know if I'm correct on the procedure
Dan56 - Yes, I have the Incorrect Count variable set to zero when entering the slide, and it shows up as zero in that red text right below CEQ.
If the user uses the shortcut keys I've defined, they just click a, b, c, and d and then click s to submit with no need to use the tab key. That works fine. The problem is when a user uses the tab key to move through the options and then clicks Enter to submit when the submit button is selected by the tab key. The variable doesn't increment when clicking enter on choices a-d. And if I use the tab/enter combo on those and then use the mouse or s for the submit button, it works fine. The problem is when I use tab to highlight the submit button and then press Enter to activate it. Then the counter jumps to two.
Lilybiri - The first action didn't need to be conditional - it's a habit from previous versions where it was an all or nothing for the whole advanced action. I've removed that. Thanks, I like clean code.
As far as the order of the other decisions, I have it checking for the correct answer first. Then if the answer isn't right, that's when I need to increment the wrong answer variable. Once the incorrect count has been incremented, it goes to the other decisions to take action. If the else (and therefore checking for the correct answer) is in the last decision, then it won't trigger the incorrect feedback.
However, I took the increment out of the Else and put it in the Then part to see what would happen. It worked as it is programmed and only incremented by one (although it's not how it needs to be since it shows the incorrect feedback when you get it all right). That made me think I could add another decision that if any one of the options a-d is incorrect (their variables are not equal to one), then it will increment the incorrect count variable without having to use Else. Alas, that didn't work. It went back to incrementing by two.
It could be worth trying this logic:
If something is incorrect, then increment vIncorrectCount
If vIncorrectCount == 1, then show first error statement
If vIncorrectCount == 2, then show second error statement
If all are correct, then show correct statement
I can't see why hitting ENTER is running your script twice or incrementing twice, so the next step is to re-arrange the order of the decisions. Obviously something is confused - perhaps this will squash the bug in the code.
Unfortunately, it didn't seem to matter what order I put these in, it always did the same thing. Ugghhhhhh!!!!!!
I'm almost at the point of just making a fifth option of all of the above and be done with it even though I loathe those types of questions.
Was asking about the Advanced Interaction to see which ation was triggered by the Submit button. In the Advanced action why did you make the first decision conditional? It is a standard action. Also, when creating a conditional action with multiple decisions, I avoid using the ELSE part, except maybe for the last decision. Can you try to change the sequence of the decisions and put the second decision as being the last one?
I agree the Correct decision is safest when last in the action.
Perhaps better to first test for anything incorrect in one decision tab:
IF vAnswerA NOT equal 1 OR
vAnswerB NOT equal 1 OR
vAnswerC NOT equal 1 OR
vAnswerD NOT equal 1
THEN increment vIncorrectCount by 1
If the logic is corect, there is no need to use that OR action. Personally I try to avoid the operator 'Not equal to' whenever possible. I am almost sure there is a logical bug somewhere, but without seeing the file cannot test.
I agree that multiple or statements with not equal to are problematic and I don't like them either. Although the problem was occurring before I had the programming that way, so there's something else going on.
Here's a link to the file if anyone wants to take a look:
I really appreciate y'all taking time to help me troubleshoot this. I've never encountered anything like this before and I'm completely stumped.