• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Why does Multiple TEB with one submit button stop working?

New Here ,
Mar 08, 2022 Mar 08, 2022

Copy link to clipboard

Copied

Hi All,

 

This is long winded, so bare with me. I have a slide with multiple TEB and one submit button. I play with this for a period, until it suddenly stops working. When I revert everything back to the original settings, it still doesn't work and validate. But I don't know why. I'll explain the scenario for those wanting to create multiple TEB, with one submit button, and maybe someone can see my mistake along the way.

 

I am creating a crossword. Each box/cell has 1 TEB in it that i use for the user to enter a letter.

I have created a separate variable for each TEB. For example, variables W, I, S, E.

I assign each variable to each TEB. e.g. W for the first TEB, I to the second, S to the third etc etc

I have created an Advanced Action. The action is conditional - Perform Actions 'IF' 'All conditions are true'

The first line of the if statement is if (variable) W contains (literal) W (Note: for some reason it wouldn't validate if I used Exact instead of Contains, but thats for another time)

then the second line goes on to the letter I, then S, then E.

The Action for this when true is Jump to Slide 3 (Congrats you got it right!)

The Else statement is Jump to Slide 2 (Incorrect, please try again)

I have then created a Smart Shape, set to 'Use as Button'. and use it as a submit button by going to Actions tab, On Success is set to 'Execute Advanced Actions', and then Ive entered the script name underneath.

 

At this point - it works.

I run it on HTML, click submit and it goes to slide 2 if i get one or more of the cells wrong, or slide 3 if i get them all right.

 

This is where the issues start. The Action is case sensitive. So I set the Variable (W) contains W, now I could write a second line for a lowercase w also. However using 2 lines for each letter makes it long and tedious. Especially if you want to change the words regularly.

So, Under the Style of the TEB, I click on the 'More options' button and set the length to 1 (so the user can only enter 1 letter), and select the Uppercase radio button.

Now, when I enter the TEB it only allows 1 letter, and converts it to uppercase no matter what I enter.

 

Now, when I play it in HTML, I enter WISE and it goes to slide 3 saying i got it correct. BUT if I test it using an incorrect answer, it again goes to Slide 3 (instead of 2). 

I don't know the exact point this stops working? It just stops after ive entered the length and uppercase. If I then go back and set the Uppercase setting back to the default 'Allow All' and delete the length altogether - it STILL doesn't work. 

 

The only way is for me to delete the entire Advanced Action, and start from scratch again. Which is not ideal when you have a rather large crossword.

 

Would anyone have any idea's why this stops, and how to fix it (without creating a new advanced action)? Does one of the settings change? Is it a Captivate bug? Any idea's?

 

 

 

 

TOPICS
Advanced , Advanced actions , Editing

Views

180

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 08, 2022 Mar 08, 2022

Copy link to clipboard

Copied

Most likely you have a bug in your Conditional Action logic.

 

To start debugging, add text objects to the slides so that you can always see on screen what the exact value of each variable is.  Otherwise you are flying blind.

 

Another problem with Conditional Actions is that sometimes the order of the decisions in the action is very important.  You need to remember that all decisions will be executed.  Sometimes a later decision will undo an earlier one.  But because it all gets executed in a split second, you cannot see what happened.  So you need to buid up the complexity slowly, checking by publishing after each change to make sure you still get the expected behaviour.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 08, 2022 Mar 08, 2022

Copy link to clipboard

Copied

Some more suggestions:

Using the More Options to limit each TEB to one letter is good, but I don't think using the option to set the letter to Uppercase is a good idea.  All that might be doing is changing the appearance of the letter in the output HTML to Uppercase via CSS code formatting, not changing what the actual value of the letter is.  That might be what is causing your interaction to break.

 

Instead, to cover situations where either a lowercase or uppercase letter is typed, I would suggest that you break up your Conditional Action so that you check the value of each TEB separately in a different decision block and then set the value of a variable for that particular cell (e,g, var_letter1, var_letter2) to either 1 or 0 so that you know if that part of the total answer was correct.

 

This means that in each decision block you need to use the OR condition not the AND condition.  So, for the first TEB cell you are checking for W or w, and if either one is found, then set var_letter1 to 1 (indicating correct answer).

 

Finally, after using separate decision blocks to check each TEB value, the final decision block will check if all of the tracking variables (var_letter1, var_letter2, etc) are set to 1. If so, the entire word is correct.  (Using separate tracking variables for each TEB also gives you the option to later highlight cells that have incorrect answers...if you wanted to get that fancy.)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 09, 2022 Mar 09, 2022

Copy link to clipboard

Copied

Thanks Rod,

Last night i did some more testing and found that if I set the variable to a lowercase, then it worked perfectly!
I am thinking what you replied with may be the answer. Possibly the 'convert to uppercase' function doesn't work the way i think it should and only converts the letter view, not the value - which may be why when i tested it between upper and lowercase it worked fine to begin with (I would have been using the Shift + key to convert to a capital when testing.) 

I think i understand what you mean by using a separate action for each TEB to test for upper and lowercase, then a final action to test each. I'll give this a go and let you know if it works.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 09, 2022 Mar 09, 2022

Copy link to clipboard

Copied

Hi Rod,

How would I 'set' the variable to 1 or 0? In the TEB condition when it was captial W, or lowercase w, i put the action as Assign, [original_variable] with 1, or else Assign, [original_variable] with 0. However the final check looked at if the variable was a 1 or 0, not a W or w?

Instead of assigning the number to the original variable - do I need to assign it to a separate variable? So the If statement is if [original variable] = W (or w), then Assign [new variable] with 1 (or else 0)?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 09, 2022 Mar 09, 2022

Copy link to clipboard

Copied

Yes, you need extra variables. You don't change the variable that is the associated variable for the TEB.  If you read my previous instructions you will see I suggested creating extra variables (one per TEB) to track whether or not the TEB field values were correct.  So, if you have four TEBs then you would have a total of eight User Variables.  Four of them would be the ones directly linked to the TEBs and the other four would be extra ones you created as tracking variables

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 10, 2022 Mar 10, 2022

Copy link to clipboard

Copied

Thanks Rod,

I must be doing something wrong as its not working for me. Would you have the checking for uppercase/lowercase etc as an entirely separate action to the submit? (in which case, how do you run the action without clicking on a button to execute it?) Or, would you do the checking for uppercase/lowercase in the 'untitled-1,2,3' etc tabs (I think they're called decisions) of the Submit action?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 10, 2022 Mar 10, 2022

Copy link to clipboard

Copied

Oh, nevermind. I just realised earlier you were mentioning decisions - so you would have it all in the same action with decisions for each letter - then the final decision would be checking if they all equal 1. I think i understand. now. Thanks!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 10, 2022 Mar 10, 2022

Copy link to clipboard

Copied

LATEST

Sorry Rod, it still won't accept a capital letter? It only accepts a lowercase letter. Can you see anything I am doing wrong in the below screenshots? FYI this is just testing on one letter (w).

When i enter any letter or a capital W, it rejects it. However if I enter a lowercase w, then it accepts it as correct.

Paul23501153jx0n_0-1646963699044.pngPaul23501153jx0n_1-1646963736849.png

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 09, 2022 Mar 09, 2022

Copy link to clipboard

Copied

Please pos a screenshot of the Preview window for the used advanced action. That would be more relevant than a very long textual explanation. You find the Preview by clicking the first button in the top right ontrol button of the Advanced Actions dialog box.

PreviewAA.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 09, 2022 Mar 09, 2022

Copy link to clipboard

Copied

Advanced Actions.png

 

Thanks, here is a screenshot of the Advanced Action, however last night i did some more testing and found that if I set the varibale to a lowercase, then it worked perfectly!
Im unsure why, but I am thinking what Rod replied with may be the answer. Possibly the 'convert to uppercase' function doesn't work the way i think it should - which may be why when i tested it between upper and lowercase it worked fine to begin with (I would have been using the Shift + key to convert to a capital.) 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources