Millisecond Forums

Conditional Branching - incorrect answer goes back to instructions page

https://forums.millisecond.com/Topic19944.aspx

By liznik - 10/25/2016

Completely new to programming, and I'm not sure what I am doing wrong at this point, I have tried to rearrange everything. What I want to happen: The participant learns the values of each picture (eg -10 points, 10 points etc) in the instructions page. (which would have the text there but i didnt bother to enter it). They will then be quizzed on the picture, and if they don't type in the right answer they will have to go back to the instructions page. The learning phase will only end if they get all the stimuli correct. I cannot get them to back to the instructions page if they get something wrong 
I have also added/taken away this attribute for the openended elements. But i'm not sure if it matters/is important for the end results 
/validresponse = ("-10", "10", "-20", "20")


<page instructions>
/1 = "text"
</page>

<trial instructions>
/ stimulusframes = [1=instructions]
/ validresponse = (" ")
/ recorddata = false
</trial>

<openended gain20house>
/stimulusframes = [1=gain20house]
/position = (50,50)
/correctresponse = ("20")
/branch = [
if (openended.gain20house.response !=("20")) trial.instructions
]
</openended>

<openended lose10animal>
/stimulusframes = [1=lose10animal]
/position = (50,50)
/correctresponse = ("-10")
/branch = [
if (openended.lose10animal.response !=("-10")) trial.instructions
]
</openended>

<openended lose20place>
/stimulusframes = [1=lose20place]
/position = (50,50)
/correctresponse = ("-20")
/branch = [
if (openended.lose20place.response !=("-20")) trial.instructions
]
</openended>

<openended gain10object>
/stimulusframes = [1=gain10object]
/position = (50,50)
/correctresponse = ("10")
/branch = [
if (openended.gain10object.response !=("10")) trial.instructions
]
</openended>
By Dave - 10/25/2016

<openended gain20house>
/stimulusframes = [1=gain20house]
/position = (50,50)
/correctresponse = ("20")
/branch = [
if (openended.gain20house.response !=("20")) trial.instructions
]

</openended>

needs to read

<openended gain20house>
/stimulusframes = [1=gain20house]
/position = (50,50)
/ validresponse = (anyresponse)
/ mask = integer
/correctresponse = ("20")
/branch = [
if (openended.gain20house.response !="20") trial.instructions
]

</openended>

i.e., not extra parentheses around "20". (Same for the /branch syntax in the other <openended> elements).

As for the rest, I can't say much because the description "They will then be quizzed on the picture, and if they don't type in the right answer they will have to go back to the instructions page. The learning phase will only end if they get all the stimuli correct." can be interpreted in a number of different ways.
Do you want them to get all questions correct in one go (i.e., complete a flawless run-through of all 4 questions)?
Or do you want to successively eliminate questions that were answered correctly? I.e., participant gets 1st question correct, gets 2nd question wrong, goes back to instructions. Moving on from there, s/he only gets questions 2, 3 and 4 (because question 1 was already answered correctly in the 1st try).
By liznik - 10/27/2016

Thank you, 

I have the instructions I want to use, just didn't bother adding it in there since I thought it wasn't necessary). We want the participants to answer the questions all correctly in one go. (They are to memorize the values of each stimuli in the instructions and be tested on it through the questions). If they get any of the 4 questions wrong they will have to redo all 4 until all 4 are correct in one go. Once they are able to get all 4 correct at once they can go into the testing phase otherwise I want it to keep looping back to in the instructions. 
By Dave - 10/27/2016

Ah, then you probably don't want to work with branching at the <openended>-level at all. Instead, I'd use a /stop attribute in the <block> to terminate it upon error, and repeat the <block> with a /branch at the <block> level in that case. In essence:

<expt>
/ blocks = [1=practice; 2=test]
</expt>

<block practice>
/ stop = [block.practice.error]
/ branch = [if (block.practice.error) block.practice]
/ preinstructions = (practice_instructions)
/ trials = [1-4 = noreplace(a,b,c,d)]
</block>

<block test>
/ preinstructions = (test_instructions)
</block>

<page practice_instructions>
^practice instructions here
</page>

<page test_instructions>
^you have completed practice & reached the test phase
</page>

<trial a>
/ stimulusframes = [1=debug]
/ validresponse = ("a", "b", "c", "d")
/ correctresponse = ("a")
</trial>

<trial b>
/ stimulusframes = [1=debug]
/ validresponse = ("a", "b", "c", "d")
/ correctresponse = ("b")
</trial>

<trial c>
/ stimulusframes = [1=debug]
/ validresponse = ("a", "b", "c", "d")
/ correctresponse = ("c")
</trial>

<trial d>
/ stimulusframes = [1=debug]
/ validresponse = ("a", "b", "c", "d")
/ correctresponse = ("d")
</trial>

<text debug>
/ items = ("The correct response is <%script.currenttrial%>")
</text>

Hope this helps.
By chenxyu - 5/16/2022

Dave - 10/27/2016
Ah, then you probably don't want to work with branching at the <openended>-level at all. Instead, I'd use a /stop attribute in the <block> to terminate it upon error, and repeat the <block> with a /branch at the <block> level in that case. In essence:

<expt>
/ blocks = [1=practice; 2=test]
</expt>

<block practice>
/ stop = [block.practice.error]
/ branch = [if (block.practice.error) block.practice]
/ preinstructions = (practice_instructions)
/ trials = [1-4 = noreplace(a,b,c,d)]
</block>

<block test>
/ preinstructions = (test_instructions)
</block>

<page practice_instructions>
^practice instructions here
</page>

<page test_instructions>
^you have completed practice & reached the test phase
</page>

<trial a>
/ stimulusframes = [1=debug]
/ validresponse = ("a", "b", "c", "d")
/ correctresponse = ("a")
</trial>

<trial b>
/ stimulusframes = [1=debug]
/ validresponse = ("a", "b", "c", "d")
/ correctresponse = ("b")
</trial>

<trial c>
/ stimulusframes = [1=debug]
/ validresponse = ("a", "b", "c", "d")
/ correctresponse = ("c")
</trial>

<trial d>
/ stimulusframes = [1=debug]
/ validresponse = ("a", "b", "c", "d")
/ correctresponse = ("d")
</trial>

<text debug>
/ items = ("The correct response is <%script.currenttrial%>")
</text>

Hope this helps.

Hi Dave,
What would you recommend if I do not want participants to start over if they answered only one question incorrectly? Specifically, they don't have to answer all questions correctly in one go, rather I want to direct them to a previous surveypage (where the instructions are embedded) if they answered one question incorrectly and then give them another chance to answer the same question until they are correct. I guess, what I'm really asking is how to branch to the instruction surveypage AND the question surveypage so they get to see the instructions and have another chance to answer the question.

I hope my questions make sense. Attached below is part of my script. With the current setup, it only branches to the instruction page, but I want it to also branch to the question.

Thank you for your time!

<textbox GroceryShoppingListTest1>
/ caption = "What is the first item on your shopping list?"
/correctresponse = ("sushi")
/validresponse=(anyresponse)
/multiline = false
/position = (10, 30)
/required = true
/ txcolor = black
</textbox>

<surveypage GroceryShoppingListTest1>
/ questions = [1=GroceryShoppingListTest1]
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ orientation = horizontal
/ showpagenumbers = false
/ showbackbutton = false
/ showquestionnumbers = false
/ branch = [ if (textbox.GroceryShoppingListTest1 !="sushi") surveypage.GroceryShoppinglist] 
</surveypage>

By Dave - 5/16/2022

chenxyu - 5/16/2022

Hi Dave,
What would you recommend if I do not want participants to start over if they answered only one question incorrectly? Specifically, they don't have to answer all questions correctly in one go, rather I want to direct them to a previous surveypage (where the instructions are embedded) if they answered one question incorrectly and then give them another chance to answer the same question until they are correct. I guess, what I'm really asking is how to branch to the instruction surveypage AND the question surveypage so they get to see the instructions and have another chance to answer the question.

I hope my questions make sense. Attached below is part of my script. With the current setup, it only branches to the instruction page, but I want it to also branch to the question.

Thank you for your time!

<textbox GroceryShoppingListTest1>
/ caption = "What is the first item on your shopping list?"
/correctresponse = ("sushi")
/validresponse=(anyresponse)
/multiline = false
/position = (10, 30)
/required = true
/ txcolor = black
</textbox>

<surveypage GroceryShoppingListTest1>
/ questions = [1=GroceryShoppingListTest1]
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ orientation = horizontal
/ showpagenumbers = false
/ showbackbutton = false
/ showquestionnumbers = false
/ branch = [ if (textbox.GroceryShoppingListTest1 !="sushi") surveypage.GroceryShoppinglist] 
</surveypage>


I can't answer that question based on an isolated, incomplete code snippet.
By chenxyu - 5/16/2022

Dave - 5/16/2022
chenxyu - 5/16/2022

Hi Dave,
What would you recommend if I do not want participants to start over if they answered only one question incorrectly? Specifically, they don't have to answer all questions correctly in one go, rather I want to direct them to a previous surveypage (where the instructions are embedded) if they answered one question incorrectly and then give them another chance to answer the same question until they are correct. I guess, what I'm really asking is how to branch to the instruction surveypage AND the question surveypage so they get to see the instructions and have another chance to answer the question.

I hope my questions make sense. Attached below is part of my script. With the current setup, it only branches to the instruction page, but I want it to also branch to the question.

Thank you for your time!

<textbox GroceryShoppingListTest1>
/ caption = "What is the first item on your shopping list?"
/correctresponse = ("sushi")
/validresponse=(anyresponse)
/multiline = false
/position = (10, 30)
/required = true
/ txcolor = black
</textbox>

<surveypage GroceryShoppingListTest1>
/ questions = [1=GroceryShoppingListTest1]
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ orientation = horizontal
/ showpagenumbers = false
/ showbackbutton = false
/ showquestionnumbers = false
/ branch = [ if (textbox.GroceryShoppingListTest1 !="sushi") surveypage.GroceryShoppinglist] 
</surveypage>


I can't answer that question based on an isolated, incomplete code snippet.

Sorry. My script might be a complete mess, but here is what I really want to do: Event 1: participants will see some general instructions; Event 2: participants will see a shopping list; Event 3: they will be tested on the list. Then, if they recall all items from the list correctly, they move on to the next phase. If not, they will go back to Event 2 and Event 3 to restudy and be tested again. My question is how can I accomplish this using /branch?
By Dave - 5/16/2022

chenxyu - 5/16/2022
Dave - 5/16/2022
chenxyu - 5/16/2022

Hi Dave,
What would you recommend if I do not want participants to start over if they answered only one question incorrectly? Specifically, they don't have to answer all questions correctly in one go, rather I want to direct them to a previous surveypage (where the instructions are embedded) if they answered one question incorrectly and then give them another chance to answer the same question until they are correct. I guess, what I'm really asking is how to branch to the instruction surveypage AND the question surveypage so they get to see the instructions and have another chance to answer the question.

I hope my questions make sense. Attached below is part of my script. With the current setup, it only branches to the instruction page, but I want it to also branch to the question.

Thank you for your time!

<textbox GroceryShoppingListTest1>
/ caption = "What is the first item on your shopping list?"
/correctresponse = ("sushi")
/validresponse=(anyresponse)
/multiline = false
/position = (10, 30)
/required = true
/ txcolor = black
</textbox>

<surveypage GroceryShoppingListTest1>
/ questions = [1=GroceryShoppingListTest1]
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ orientation = horizontal
/ showpagenumbers = false
/ showbackbutton = false
/ showquestionnumbers = false
/ branch = [ if (textbox.GroceryShoppingListTest1 !="sushi") surveypage.GroceryShoppinglist] 
</surveypage>


I can't answer that question based on an isolated, incomplete code snippet.

Sorry. My script might be a complete mess, but here is what I really want to do: Event 1: participants will see some general instructions; Event 2: participants will see a shopping list; Event 3: they will be tested on the list. Then, if they recall all items from the list correctly, they move on to the next phase. If not, they will go back to Event 2 and Event 3 to restudy and be tested again. My question is how can I accomplish this using /branch?

Are they to be restested on the *entire* list ("Event 3") as you state now or only on the items they got wrong as you suggested earlier (" [...] if they answered one question incorrectly and then give them another chance to answer the same question until they are correct.")? These are obviously not the same, so please be precise.

Further, if you won't provide your actual code, I don't know how to help you. So maybe clean things up or at least provide a stripped down version that shows what you are actually doing
By chenxyu - 5/16/2022

They will not be retested for the entire list. For instance, if one person answers the first three questions right but the last one wrong, they will not have to start from question one after viewing the list again. There are four <textbox> questions on <surveypages>. Please see below.

Thank you so much for your help!


<textbox GroceryShoppingListTest1>
/ caption = "What is the first item on your shopping list?"
/correctresponse = ("sushi")
/validresponse=(anyresponse)
/multiline = false
/position = (10, 30)
/required = true
/ txcolor = black
</textbox>

<textbox GroceryShoppingListTest2>
/ caption = "What is the second item on your shopping list?"
/correctresponse = ("coffee")
/validresponse=(anyresponse)
/multiline = false
/position = (10, 30)
/required = true
/ txcolor = black
</textbox>

<textbox GroceryShoppingListTest3>
/ caption = "What is the third item on your shopping list?"
/correctresponse = ("detergent")
/validresponse=(anyresponse)
/multiline = false
/position = (10, 30)
/required = true
/ txcolor = black
</textbox>

<textbox GroceryShoppingListTest4>
/ caption = "What is the fourth item on your shopping list?"
/correctresponse = ("peanut butter")
/validresponse=(anyresponse)
/multiline = false
/position = (10, 30)
/required = true
/ txcolor = black
</textbox>

<surveypage GroceryShoppingListTest1>
/ questions = [1=GroceryShoppingListTest1]
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ orientation = horizontal
/ showpagenumbers = false
/ showbackbutton = false       
/ showquestionnumbers = false  
/branch= [if (textbox.GroceryShoppingListTest1.response != "sushi") surveypage.GroceryShoppingList]  
</surveypage>

<surveypage GroceryShoppingListTest2>
/ questions = [1=GroceryShoppingListTest2]
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ orientation = horizontal
/ showpagenumbers = false
/ showbackbutton = false
/ showquestionnumbers = false
[if (textbox.GroceryShoppingListTest2.response != "coffee") surveypage.GroceryShoppingList]
</surveypage>

<surveypage GroceryShoppingListTest3>
/ questions = [1=GroceryShoppingListTest3]
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ orientation = horizontal
/ showpagenumbers = false
/ showbackbutton = false
/ showquestionnumbers = false
[if (textbox.GroceryShoppingListTest3.response != "detergent") surveypage.GroceryShoppingList]
</surveypage>

<surveypage GroceryShoppingListTest4>
/ questions = [1=GroceryShoppingListTest4]
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ orientation = horizontal
/ showpagenumbers = false
/ showbackbutton = false
/ showquestionnumbers = false
[if (textbox.GroceryShoppingListTest4.response != "peanut butter") surveypage.GroceryShoppingList]
</surveypage>
By Dave - 5/16/2022

chenxyu - 5/16/2022
They will not be retested for the entire list. For instance, if one person answers the first three questions right but the last one wrong, they will not have to start from question one after viewing the list again. There are four <textbox> questions on <surveypages>. Please see below.

Thank you so much for your help!


<textbox GroceryShoppingListTest1>
/ caption = "What is the first item on your shopping list?"
/correctresponse = ("sushi")
/validresponse=(anyresponse)
/multiline = false
/position = (10, 30)
/required = true
/ txcolor = black
</textbox>

<textbox GroceryShoppingListTest2>
/ caption = "What is the second item on your shopping list?"
/correctresponse = ("coffee")
/validresponse=(anyresponse)
/multiline = false
/position = (10, 30)
/required = true
/ txcolor = black
</textbox>

<textbox GroceryShoppingListTest3>
/ caption = "What is the third item on your shopping list?"
/correctresponse = ("detergent")
/validresponse=(anyresponse)
/multiline = false
/position = (10, 30)
/required = true
/ txcolor = black
</textbox>

<textbox GroceryShoppingListTest4>
/ caption = "What is the fourth item on your shopping list?"
/correctresponse = ("peanut butter")
/validresponse=(anyresponse)
/multiline = false
/position = (10, 30)
/required = true
/ txcolor = black
</textbox>

<surveypage GroceryShoppingListTest1>
/ questions = [1=GroceryShoppingListTest1]
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ orientation = horizontal
/ showpagenumbers = false
/ showbackbutton = false       
/ showquestionnumbers = false  
/branch= [if (textbox.GroceryShoppingListTest1.response != "sushi") surveypage.GroceryShoppingList]  
</surveypage>

<surveypage GroceryShoppingListTest2>
/ questions = [1=GroceryShoppingListTest2]
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ orientation = horizontal
/ showpagenumbers = false
/ showbackbutton = false
/ showquestionnumbers = false
[if (textbox.GroceryShoppingListTest2.response != "coffee") surveypage.GroceryShoppingList]
</surveypage>

<surveypage GroceryShoppingListTest3>
/ questions = [1=GroceryShoppingListTest3]
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ orientation = horizontal
/ showpagenumbers = false
/ showbackbutton = false
/ showquestionnumbers = false
[if (textbox.GroceryShoppingListTest3.response != "detergent") surveypage.GroceryShoppingList]
</surveypage>

<surveypage GroceryShoppingListTest4>
/ questions = [1=GroceryShoppingListTest4]
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ orientation = horizontal
/ showpagenumbers = false
/ showbackbutton = false
/ showquestionnumbers = false
[if (textbox.GroceryShoppingListTest4.response != "peanut butter") surveypage.GroceryShoppingList]
</surveypage>

Look, four surveypages tell me nothing -- how are these actually run? In a block? In a survey? Selected randomly? Sequentially?

Please provide something that can actually be run and accurately conveys your actual setup. Thanks.
By chenxyu - 5/16/2022

They are run in a block. Here is the entire script without any branch:

<caption GroceryShoppingListInstructions>
/ caption = "On the next page, you will see your shopping list. Pay attention to the shopping items as you will need to remember them for the grocery shopping task."
/ position = (3,40)
</caption>

<surveypage GroceryShoppingListInstructions>
/ questions = [1=GroceryShoppingListInstructions]
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ txcolor = black
/ orientation = horizontal
/ showpagenumbers = false
/ showbackbutton = false
</surveypage>

<caption GroceryShoppingList_OngoingOnly>
/ caption = "Here are the items you will need to purchase from the grocery store:

    1. Sushi
            
    2. Coffee
            
    3. Detergent
            
    4. Peanut Butter
            
Study these items so that you have them memorized for the upcoming grocery shopping task.

        (This screen will advance automatically after 15 seconds)"
/ position = (5,20)
</caption>

<surveypage GroceryShoppingList_OngoingOnly>
/ questions = [1=GroceryShoppingList_OngoingOnly]
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ txcolor = black
/ orientation = horizontal
/ showpagenumbers = false
/ showbackbutton = false
/ shownextbutton = false
/ timeout = 15000
</surveypage>

<caption GroceryShoppingListTestInstruction_OngoingOnly>
/ caption = "You will now be tested on the shopping items. The shopping list page will reappear until you recall all items correctly."
/ position = (3, 40)
</caption>

<surveypage GroceryShoppingListTestInstruction_Ongoingonly>
/ questions = [1=GroceryShoppingListTestInstruction_OngoingOnly]
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ txcolor = black
/ orientation = horizontal
/ showpagenumbers = false
/ showbackbutton = false
</surveypage>

<textbox GroceryShoppingListTest1>
/ caption = "What is the first item on your shopping list?"
/correctresponse = ("sushi")
/validresponse=(anyresponse)
/multiline = false
/position = (10, 30)
/required = true
/ txcolor = black
</textbox>

<textbox GroceryShoppingListTest2>
/ caption = "What is the second item on your shopping list?"
/correctresponse = ("coffee")
/validresponse=(anyresponse)
/multiline = false
/position = (10, 30)
/required = true
/ txcolor = black
</textbox>

<textbox GroceryShoppingListTest3>
/ caption = "What is the third item on your shopping list?"
/correctresponse = ("detergent")
/validresponse=(anyresponse)
/multiline = false
/position = (10, 30)
/required = true
/ txcolor = black
</textbox>

<textbox GroceryShoppingListTest4>
/ caption = "What is the fourth item on your shopping list?"
/correctresponse = ("peanut butter")
/validresponse=(anyresponse)
/multiline = false
/position = (10, 30)
/required = true
/ txcolor = black
</textbox>

<surveypage GroceryShoppingListTest1>
/ questions = [1=GroceryShoppingListTest1]
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ orientation = horizontal
/ showpagenumbers = false
/ showbackbutton = false
/ showquestionnumbers = false
</surveypage>

<surveypage GroceryShoppingListTest2>
/ questions = [1=GroceryShoppingListTest2]
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ orientation = horizontal
/ showpagenumbers = false
/ showbackbutton = false
/ showquestionnumbers = false
</surveypage>

<surveypage GroceryShoppingListTest3>
/ questions = [1=GroceryShoppingListTest3]
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ orientation = horizontal
/ showpagenumbers = false
/ showbackbutton = false
/ showquestionnumbers = false
</surveypage>

<surveypage GroceryShoppingListTest4>
/ questions = [1=GroceryShoppingListTest4]
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ orientation = horizontal
/ showpagenumbers = false
/ showbackbutton = false
/ showquestionnumbers = false
</surveypage>

<block GroceryShoppingTest>
/ trials = [1=GroceryShoppingListInstructions;
2=GroceryShoppingList_OngoingOnly;
3=GroceryShoppingListTestInstruction_Ongoingonly;
4=GroceryShoppingListTest1;
5=surveypage.GroceryShoppingListTest2;
6=GroceryShoppingListTest3;
7=GroceryShoppingListTest4]
</block>

By Dave - 5/16/2022

chenxyu - 5/16/2022
They are run in a block. Here is the entire script without any branch:

<caption GroceryShoppingListInstructions>
/ caption = "On the next page, you will see your shopping list. Pay attention to the shopping items as you will need to remember them for the grocery shopping task."
/ position = (3,40)
</caption>

<surveypage GroceryShoppingListInstructions>
/ questions = [1=GroceryShoppingListInstructions]
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ txcolor = black
/ orientation = horizontal
/ showpagenumbers = false
/ showbackbutton = false
</surveypage>

<caption GroceryShoppingList_OngoingOnly>
/ caption = "Here are the items you will need to purchase from the grocery store:

    1. Sushi
            
    2. Coffee
            
    3. Detergent
            
    4. Peanut Butter
            
Study these items so that you have them memorized for the upcoming grocery shopping task.

        (This screen will advance automatically after 15 seconds)"
/ position = (5,20)
</caption>

<surveypage GroceryShoppingList_OngoingOnly>
/ questions = [1=GroceryShoppingList_OngoingOnly]
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ txcolor = black
/ orientation = horizontal
/ showpagenumbers = false
/ showbackbutton = false
/ shownextbutton = false
/ timeout = 15000
</surveypage>

<caption GroceryShoppingListTestInstruction_OngoingOnly>
/ caption = "You will now be tested on the shopping items. The shopping list page will reappear until you recall all items correctly."
/ position = (3, 40)
</caption>

<surveypage GroceryShoppingListTestInstruction_Ongoingonly>
/ questions = [1=GroceryShoppingListTestInstruction_OngoingOnly]
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ txcolor = black
/ orientation = horizontal
/ showpagenumbers = false
/ showbackbutton = false
</surveypage>

<textbox GroceryShoppingListTest1>
/ caption = "What is the first item on your shopping list?"
/correctresponse = ("sushi")
/validresponse=(anyresponse)
/multiline = false
/position = (10, 30)
/required = true
/ txcolor = black
</textbox>

<textbox GroceryShoppingListTest2>
/ caption = "What is the second item on your shopping list?"
/correctresponse = ("coffee")
/validresponse=(anyresponse)
/multiline = false
/position = (10, 30)
/required = true
/ txcolor = black
</textbox>

<textbox GroceryShoppingListTest3>
/ caption = "What is the third item on your shopping list?"
/correctresponse = ("detergent")
/validresponse=(anyresponse)
/multiline = false
/position = (10, 30)
/required = true
/ txcolor = black
</textbox>

<textbox GroceryShoppingListTest4>
/ caption = "What is the fourth item on your shopping list?"
/correctresponse = ("peanut butter")
/validresponse=(anyresponse)
/multiline = false
/position = (10, 30)
/required = true
/ txcolor = black
</textbox>

<surveypage GroceryShoppingListTest1>
/ questions = [1=GroceryShoppingListTest1]
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ orientation = horizontal
/ showpagenumbers = false
/ showbackbutton = false
/ showquestionnumbers = false
</surveypage>

<surveypage GroceryShoppingListTest2>
/ questions = [1=GroceryShoppingListTest2]
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ orientation = horizontal
/ showpagenumbers = false
/ showbackbutton = false
/ showquestionnumbers = false
</surveypage>

<surveypage GroceryShoppingListTest3>
/ questions = [1=GroceryShoppingListTest3]
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ orientation = horizontal
/ showpagenumbers = false
/ showbackbutton = false
/ showquestionnumbers = false
</surveypage>

<surveypage GroceryShoppingListTest4>
/ questions = [1=GroceryShoppingListTest4]
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ orientation = horizontal
/ showpagenumbers = false
/ showbackbutton = false
/ showquestionnumbers = false
</surveypage>

<block GroceryShoppingTest>
/ trials = [1=GroceryShoppingListInstructions;
2=GroceryShoppingList_OngoingOnly;
3=GroceryShoppingListTestInstruction_Ongoingonly;
4=GroceryShoppingListTest1;
5=surveypage.GroceryShoppingListTest2;
6=GroceryShoppingListTest3;
7=GroceryShoppingListTest4]
</block>


<caption GroceryShoppingListInstructions>
/ caption = "On the next page, you will see your shopping list. Pay attention to the shopping items as you will need to remember them for the grocery shopping task."
/ position = (3,40)
</caption>

<surveypage GroceryShoppingListInstructions>
/ questions = [1=GroceryShoppingListInstructions]
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ txcolor = black
/ orientation = horizontal
/ showpagenumbers = false
/ showbackbutton = false
</surveypage>

<caption GroceryShoppingList_OngoingOnly>
/ caption = "Here are the items you will need to purchase from the grocery store:

1. Sushi

2. Coffee

3. Detergent

4. Peanut Butter

Study these items so that you have them memorized for the upcoming grocery shopping task.

(This screen will advance automatically after 15 seconds)"
/ position = (5,20)
</caption>

<surveypage GroceryShoppingList_OngoingOnly>
/ questions = [1=GroceryShoppingList_OngoingOnly]
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ txcolor = black
/ orientation = horizontal
/ showpagenumbers = false
/ showbackbutton = false
/ shownextbutton = false
/ timeout = 15000
</surveypage>

<caption GroceryShoppingListTestInstruction_OngoingOnly>
/ caption = "You will now be tested on the shopping items. The shopping list page will reappear until you recall all items correctly."
/ position = (3, 40)
</caption>

<surveypage GroceryShoppingListTestInstruction_Ongoingonly>
/ questions = [1=GroceryShoppingListTestInstruction_OngoingOnly]
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ txcolor = black
/ orientation = horizontal
/ showpagenumbers = false
/ showbackbutton = false
</surveypage>

<textbox GroceryShoppingListTest1>
/ caption = "What is the first item on your shopping list?"
/correctresponse = ("sushi")
/validresponse=(anyresponse)
/multiline = false
/position = (10, 30)
/required = true
/ txcolor = black
</textbox>

<textbox GroceryShoppingListTest2>
/ caption = "What is the second item on your shopping list?"
/correctresponse = ("coffee")
/validresponse=(anyresponse)
/multiline = false
/position = (10, 30)
/required = true
/ txcolor = black
</textbox>

<textbox GroceryShoppingListTest3>
/ caption = "What is the third item on your shopping list?"
/correctresponse = ("detergent")
/validresponse=(anyresponse)
/multiline = false
/position = (10, 30)
/required = true
/ txcolor = black
</textbox>

<textbox GroceryShoppingListTest4>
/ caption = "What is the fourth item on your shopping list?"
/correctresponse = ("peanut butter")
/validresponse=(anyresponse)
/multiline = false
/position = (10, 30)
/required = true
/ txcolor = black
</textbox>

<surveypage GroceryShoppingListTest1>
/ skip = [
    values.q1_correct;
]
/ questions = [1=GroceryShoppingListTest1]
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ orientation = horizontal
/ showpagenumbers = false
/ showbackbutton = false
/ showquestionnumbers = false
/ ontrialend = [
    if (textbox.GroceryShoppingListTest1.response == "sushi") {
        values.q1_correct = true;
    };
]
</surveypage>

<surveypage GroceryShoppingListTest2>
/ skip = [
    values.q2_correct;
]
/ questions = [1=GroceryShoppingListTest2]
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ orientation = horizontal
/ showpagenumbers = false
/ showbackbutton = false
/ showquestionnumbers = false
/ ontrialend = [
    if (textbox.GroceryShoppingListTest2.response == "coffee") {
        values.q2_correct = true;
    };
]
</surveypage>

<surveypage GroceryShoppingListTest3>
/ skip = [
    values.q3_correct;
]
/ questions = [1=GroceryShoppingListTest3]
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ orientation = horizontal
/ showpagenumbers = false
/ showbackbutton = false
/ showquestionnumbers = false
/ ontrialend = [
    if (textbox.GroceryShoppingListTest3.response == "detergent") {
        values.q3_correct = true;
    };
]
</surveypage>

<surveypage GroceryShoppingListTest4>
/ skip = [
    values.q4_correct;
]
/ questions = [1=GroceryShoppingListTest4]
/ fontstyle = ("Arial", 4.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3.5%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ orientation = horizontal
/ showpagenumbers = false
/ showbackbutton = false
/ showquestionnumbers = false
/ ontrialend = [
    if (textbox.GroceryShoppingListTest4.response == "peanut butter") {
        values.q4_correct = true;
    };
]
</surveypage>

<block GroceryShoppingTest>
/ trials = [1=GroceryShoppingListInstructions;
2=GroceryShoppingList_OngoingOnly;
3=GroceryShoppingListTestInstruction_Ongoingonly;
4=GroceryShoppingListTest1;
5=GroceryShoppingListTest2;
6=GroceryShoppingListTest3;
7=GroceryShoppingListTest4]
/ branch = [
    if (!values.q1_correct || !values.q2_correct || !values.q3_correct || !values.q4_correct) {
        block.GroceryShoppingTest;
    };
]
</block>

<values>
/ q1_correct = false
/ q2_correct = false
/ q3_correct = false
/ q4_correct = false
</values>

<expt>
/ blocks = [1=GroceryShoppingTest]
</expt>
By chenxyu - 5/16/2022

Thank you so much!