Conditional Branching - incorrect answer goes back to instructions page


Author
Message
chenxyu
chenxyu
Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)
Group: Forum Members
Posts: 18, Visits: 252
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>


Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
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>

chenxyu
chenxyu
Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)
Group: Forum Members
Posts: 18, Visits: 252
Thank you so much!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search