Millisecond Forums

sequencing valid responses

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

By troyh - 2/4/2021

Any idea why the valid response for trials stays at "Robe" regarding the attached script? rather than going through the specified sequence (in text.itemcounter) ?

<values>
/roomconstraint = 0
/n_roomitems = 0
/item1_nclicks = 0
/item2_nclicks = 0
/item3_nclicks = 0
/item4_nclicks = 0
/lastresponse = ""
/constraint_met = false
/itemdescription = 1
/buttontext = ""
/keytext = ""
</values>

%%%%%%%%%%%%%%%% stims

<text room1>
/items = ("THE FOG ROOM
The room is like a large cube that simultaneously stretches into an impossibly long rectangle. Its four walls are emblazoned with archaic symbols, some of which shine forth through the thick, billowing fog that fills the room. You squint, trying to make out the fuzzy figures behind the fog.")
/erase = false
/position = (50%,30%)
/size = (600,300)
/color = darkorange
</text>
<text room2>
/items = ("THE CLOUD ROOM
You blink a few times, trying to adjust to the rapid change of scenery, as you find yourself in a second room, which seems quite ordinary, save the sky for a ceiling. Clouds and birds drifted by overhead. Moreover, the floor is rough and uneven, like some kind of rocky terrain.")
/position = (50%,30%)
/size = (600,300)
/erase = false
/color = darkblue
</text>
<text potion>
/items = ("Potion")
/erase = false
/position = (75%,82%)
/color = darkblue
/fontstyle = ("Old English Text MT", 3.65%, false, false, false, false, 5, 1)
</text>
<text dragon>
/items = ("Dragon")
/erase = false
/position = (75%,82%)
/color = darkorange
/fontstyle = ("Old English Text MT", 3.65%, false, false, false, false, 5, 1)
</text>
<text robe>
/items = ("Robe")
/erase = false
/position = (50%,48%)
/color = darkorange
/fontstyle = ("Old English Text MT", 3.65%, false, false, false, false, 5, 1)
</text>
<text crystalball>
/items = ("Crystal Ball")
/erase = false
/position = (75%,48%)
/color = darkblue
/fontstyle = ("Old English Text MT", 3.65%, false, false, false, false, 5, 1)
</text>
<text quiver>
/items = ("Quiver")
/erase = false
/position = (20%,82%)
/color = darkblue
/fontstyle = ("Old English Text MT", 3.65%, false, false, false, false, 5, 1)
</text>
<text quilt>
/items = ("Quilt")
/erase = false
/position = (20%,48%)
/color = darkblue
/fontstyle = ("Old English Text MT", 3.65%, false, false, false, false, 5, 1)
</text>
<text plant>
/items = ("Plant")
/erase = false
/position = (75%,48%)
/color = darkorange
/fontstyle = ("Old English Text MT", 3.65%, false, false, false, false, 5, 1)
</text>
%%%%%%%%%%%%%% "room" border
<shape leftside>
/shape = rectangle
/size = (0.4%,50%)
/position = (15%,65%)
</shape>
<shape rightside>
/shape = rectangle
/size = (0.4%,50%)
/position = (85%,65%)
</shape>
<shape top>
/shape = rectangle
/position = (50%,40%)
/size = (70.5%,0.5%)
</shape>
<shape bottom>
/shape = rectangle
/position = (50%,90%)
/size = (70.5%,0.5%)
</shape>


%%%%%% continue button
<button return>
/caption = "<%values.buttontext%>"
/size = (10%,5%)
/position = (50%,75%)
</button>

%%%%%%%%%%%%% item descriptions

<text room1_itemdescriptions>
/items = ("Dragon
You tentatively step closer and suddenly a fold of skin the size of your torso slides back on the dragon's head to reveal a menacing yellow eye with pulsating veins. In a single fluid motion, the monster rises to its full height and unleashes from its mouth a trail of yellow-orange fire.

~n<%values.keytext%>",
"Robe
You turn to the old wizard robe--the most unappealing object in the room. It wreaks of putrid garlic, yet oddly, also something sweet. Its fabric is gray and akin to basket weave, making you wonder how anyone can wear such a thing.

~n<%values.keytext%>",
"Plant
As you near the plant, one of its round fruits expands rapidly to the size of your head, transforming into a monstrous creature with a fanged mouth, covered in long hairs. Its smell is intoxicating--cinnamon mixed with vanilla.

~n<%values.keytext%>")
/select = values.itemdescription
/erase = false
/position = (50%,50%)
/color = darkorange
/size = (50%,25%)
</text>









<text itemcounter>
/items = ("Robe", "Plant","Dragon")
/select = sequence
/ selectionrate = always
</text>

<trial room1>
/ontrialbegin = [
    values.lastresponse = trial.room1.response;
]
/stimulusframes = [
    1=clearscreen; 2=room1,dragon,robe,plant,leftside,rightside,top,bottom
]
/inputdevice = mouse
/ isvalidresponse = [
    trial.room1.response == text.itemcounter.currentitem
]
/ontrialend = [
    if (trial.room1.response == "Dragon"){
        values.itemdescription = 1;
        values.item1_nclicks += 1;
    } else if (trial.room1.response == "Robe"){
        values.itemdescription = 2;
        values.item2_nclicks += 1;
    } else if (trial.room1.response == "Plant"){
        values.itemdescription = 3;
        values.item3_nclicks += 1;
    }
]
/branch = [
    trial.room1_itemdescriptions;
]
</trial>

<trial room1_itemdescriptions>
/ontrialbegin = [
    if (values.constraint_met) {
        values.buttontext = "CONTINUE";
    };
]
/stimulusframes = [
    1=clearscreen,room1_itemdescriptions,return
]
/inputdevice = mouse
/validresponse = (return)

</trial>

<block myblock>
/ onblockbegin = [
values.lastresponse = "";
]
/trials = [
    1-5 = room1
]

</block>
By Dave - 2/4/2021

troyh - 2/4/2021
Any idea why the valid response for trials stays at "Robe" regarding the attached script? rather than going through the specified sequence (in text.itemcounter) ?

<values>
/roomconstraint = 0
/n_roomitems = 0
/item1_nclicks = 0
/item2_nclicks = 0
/item3_nclicks = 0
/item4_nclicks = 0
/lastresponse = ""
/constraint_met = false
/itemdescription = 1
/buttontext = ""
/keytext = ""
</values>

%%%%%%%%%%%%%%%% stims

<text room1>
/items = ("THE FOG ROOM
The room is like a large cube that simultaneously stretches into an impossibly long rectangle. Its four walls are emblazoned with archaic symbols, some of which shine forth through the thick, billowing fog that fills the room. You squint, trying to make out the fuzzy figures behind the fog.")
/erase = false
/position = (50%,30%)
/size = (600,300)
/color = darkorange
</text>
<text room2>
/items = ("THE CLOUD ROOM
You blink a few times, trying to adjust to the rapid change of scenery, as you find yourself in a second room, which seems quite ordinary, save the sky for a ceiling. Clouds and birds drifted by overhead. Moreover, the floor is rough and uneven, like some kind of rocky terrain.")
/position = (50%,30%)
/size = (600,300)
/erase = false
/color = darkblue
</text>
<text potion>
/items = ("Potion")
/erase = false
/position = (75%,82%)
/color = darkblue
/fontstyle = ("Old English Text MT", 3.65%, false, false, false, false, 5, 1)
</text>
<text dragon>
/items = ("Dragon")
/erase = false
/position = (75%,82%)
/color = darkorange
/fontstyle = ("Old English Text MT", 3.65%, false, false, false, false, 5, 1)
</text>
<text robe>
/items = ("Robe")
/erase = false
/position = (50%,48%)
/color = darkorange
/fontstyle = ("Old English Text MT", 3.65%, false, false, false, false, 5, 1)
</text>
<text crystalball>
/items = ("Crystal Ball")
/erase = false
/position = (75%,48%)
/color = darkblue
/fontstyle = ("Old English Text MT", 3.65%, false, false, false, false, 5, 1)
</text>
<text quiver>
/items = ("Quiver")
/erase = false
/position = (20%,82%)
/color = darkblue
/fontstyle = ("Old English Text MT", 3.65%, false, false, false, false, 5, 1)
</text>
<text quilt>
/items = ("Quilt")
/erase = false
/position = (20%,48%)
/color = darkblue
/fontstyle = ("Old English Text MT", 3.65%, false, false, false, false, 5, 1)
</text>
<text plant>
/items = ("Plant")
/erase = false
/position = (75%,48%)
/color = darkorange
/fontstyle = ("Old English Text MT", 3.65%, false, false, false, false, 5, 1)
</text>
%%%%%%%%%%%%%% "room" border
<shape leftside>
/shape = rectangle
/size = (0.4%,50%)
/position = (15%,65%)
</shape>
<shape rightside>
/shape = rectangle
/size = (0.4%,50%)
/position = (85%,65%)
</shape>
<shape top>
/shape = rectangle
/position = (50%,40%)
/size = (70.5%,0.5%)
</shape>
<shape bottom>
/shape = rectangle
/position = (50%,90%)
/size = (70.5%,0.5%)
</shape>


%%%%%% continue button
<button return>
/caption = "<%values.buttontext%>"
/size = (10%,5%)
/position = (50%,75%)
</button>

%%%%%%%%%%%%% item descriptions

<text room1_itemdescriptions>
/items = ("Dragon
You tentatively step closer and suddenly a fold of skin the size of your torso slides back on the dragon's head to reveal a menacing yellow eye with pulsating veins. In a single fluid motion, the monster rises to its full height and unleashes from its mouth a trail of yellow-orange fire.

~n<%values.keytext%>",
"Robe
You turn to the old wizard robe--the most unappealing object in the room. It wreaks of putrid garlic, yet oddly, also something sweet. Its fabric is gray and akin to basket weave, making you wonder how anyone can wear such a thing.

~n<%values.keytext%>",
"Plant
As you near the plant, one of its round fruits expands rapidly to the size of your head, transforming into a monstrous creature with a fanged mouth, covered in long hairs. Its smell is intoxicating--cinnamon mixed with vanilla.

~n<%values.keytext%>")
/select = values.itemdescription
/erase = false
/position = (50%,50%)
/color = darkorange
/size = (50%,25%)
</text>









<text itemcounter>
/items = ("Robe", "Plant","Dragon")
/select = sequence
/ selectionrate = always
</text>

<trial room1>
/ontrialbegin = [
    values.lastresponse = trial.room1.response;
]
/stimulusframes = [
    1=clearscreen; 2=room1,dragon,robe,plant,leftside,rightside,top,bottom
]
/inputdevice = mouse
/ isvalidresponse = [
    trial.room1.response == text.itemcounter.currentitem
]
/ontrialend = [
    if (trial.room1.response == "Dragon"){
        values.itemdescription = 1;
        values.item1_nclicks += 1;
    } else if (trial.room1.response == "Robe"){
        values.itemdescription = 2;
        values.item2_nclicks += 1;
    } else if (trial.room1.response == "Plant"){
        values.itemdescription = 3;
        values.item3_nclicks += 1;
    }
]
/branch = [
    trial.room1_itemdescriptions;
]
</trial>

<trial room1_itemdescriptions>
/ontrialbegin = [
    if (values.constraint_met) {
        values.buttontext = "CONTINUE";
    };
]
/stimulusframes = [
    1=clearscreen,room1_itemdescriptions,return
]
/inputdevice = mouse
/validresponse = (return)

</trial>

<block myblock>
/ onblockbegin = [
values.lastresponse = "";
]
/trials = [
    1-5 = room1
]

</block>

/ isvalidresponse = [
  trial.room1.response == text.itemcounter.currentitem
]

That <text> element is never displayed, hence no selection on it ever occurs and its current item never changes.

It is better to use a <list>, not a stimulus element like <text> for such purposes. In addition, all possible options should be listed in /validresponse, /isvalidresponse can then be used to validate only one of them.


Any idea why the valid response for trials stays at "Robe" regarding the attached script? rather than going through the specified sequence (in text.itemcounter) ?

<values>
/roomconstraint = 0
/n_roomitems = 0
/item1_nclicks = 0
/item2_nclicks = 0
/item3_nclicks = 0
/item4_nclicks = 0
/lastresponse = ""
/constraint_met = false
/itemdescription = 1
/buttontext = ""
/keytext = ""
</values>

%%%%%%%%%%%%%%%% stims

<text room1>
/items = ("THE FOG ROOM
The room is like a large cube that simultaneously stretches into an impossibly long rectangle. Its four walls are emblazoned with archaic symbols, some of which shine forth through the thick, billowing fog that fills the room. You squint, trying to make out the fuzzy figures behind the fog.")
/erase = false
/position = (50%,30%)
/size = (600,300)
/color = darkorange
</text>
<text room2>
/items = ("THE CLOUD ROOM
You blink a few times, trying to adjust to the rapid change of scenery, as you find yourself in a second room, which seems quite ordinary, save the sky for a ceiling. Clouds and birds drifted by overhead. Moreover, the floor is rough and uneven, like some kind of rocky terrain.")
/position = (50%,30%)
/size = (600,300)
/erase = false
/color = darkblue
</text>
<text potion>
/items = ("Potion")
/erase = false
/position = (75%,82%)
/color = darkblue
/fontstyle = ("Old English Text MT", 3.65%, false, false, false, false, 5, 1)
</text>
<text dragon>
/items = ("Dragon")
/erase = false
/position = (75%,82%)
/color = darkorange
/fontstyle = ("Old English Text MT", 3.65%, false, false, false, false, 5, 1)
</text>
<text robe>
/items = ("Robe")
/erase = false
/position = (50%,48%)
/color = darkorange
/fontstyle = ("Old English Text MT", 3.65%, false, false, false, false, 5, 1)
</text>
<text crystalball>
/items = ("Crystal Ball")
/erase = false
/position = (75%,48%)
/color = darkblue
/fontstyle = ("Old English Text MT", 3.65%, false, false, false, false, 5, 1)
</text>
<text quiver>
/items = ("Quiver")
/erase = false
/position = (20%,82%)
/color = darkblue
/fontstyle = ("Old English Text MT", 3.65%, false, false, false, false, 5, 1)
</text>
<text quilt>
/items = ("Quilt")
/erase = false
/position = (20%,48%)
/color = darkblue
/fontstyle = ("Old English Text MT", 3.65%, false, false, false, false, 5, 1)
</text>
<text plant>
/items = ("Plant")
/erase = false
/position = (75%,48%)
/color = darkorange
/fontstyle = ("Old English Text MT", 3.65%, false, false, false, false, 5, 1)
</text>
%%%%%%%%%%%%%% "room" border
<shape leftside>
/shape = rectangle
/size = (0.4%,50%)
/position = (15%,65%)
</shape>
<shape rightside>
/shape = rectangle
/size = (0.4%,50%)
/position = (85%,65%)
</shape>
<shape top>
/shape = rectangle
/position = (50%,40%)
/size = (70.5%,0.5%)
</shape>
<shape bottom>
/shape = rectangle
/position = (50%,90%)
/size = (70.5%,0.5%)
</shape>


%%%%%% continue button
<button return>
/caption = "<%values.buttontext%>"
/size = (10%,5%)
/position = (50%,75%)
</button>

%%%%%%%%%%%%% item descriptions

<text room1_itemdescriptions>
/items = ("Dragon
You tentatively step closer and suddenly a fold of skin the size of your torso slides back on the dragon's head to reveal a menacing yellow eye with pulsating veins. In a single fluid motion, the monster rises to its full height and unleashes from its mouth a trail of yellow-orange fire.

~n<%values.keytext%>",
"Robe
You turn to the old wizard robe--the most unappealing object in the room. It wreaks of putrid garlic, yet oddly, also something sweet. Its fabric is gray and akin to basket weave, making you wonder how anyone can wear such a thing.

~n<%values.keytext%>",
"Plant
As you near the plant, one of its round fruits expands rapidly to the size of your head, transforming into a monstrous creature with a fanged mouth, covered in long hairs. Its smell is intoxicating--cinnamon mixed with vanilla.

~n<%values.keytext%>")
/select = values.itemdescription
/erase = false
/position = (50%,50%)
/color = darkorange
/size = (50%,25%)
</text>









<list itemcounter>
/items = ("robe", "plant","dragon")
/selectionmode = sequence
/ selectionrate = trial
</list>

<trial room1>
/ontrialbegin = [
values.lastresponse = trial.room1.response;
]
/stimulusframes = [
1=clearscreen; 2=room1,dragon,robe,plant,leftside,rightside,top,bottom
]
/inputdevice = mouse
/ validresponse = (dragon, robe, plant)
/ isvalidresponse = [
trial.room1.response == list.itemcounter.nextvalue
]
/ontrialend = [
if (trial.room1.response == "dragon"){
values.itemdescription = 1;
values.item1_nclicks += 1;
} else if (trial.room1.response == "robe"){
values.itemdescription = 2;
values.item2_nclicks += 1;
} else if (trial.room1.response == "plant"){
values.itemdescription = 3;
values.item3_nclicks += 1;
}
]
/branch = [
trial.room1_itemdescriptions;
]
</trial>

<trial room1_itemdescriptions>
/ontrialbegin = [
if (values.constraint_met) {
values.buttontext = "CONTINUE";
};
]
/stimulusframes = [
1=clearscreen,room1_itemdescriptions,return
]
/inputdevice = mouse
/validresponse = (return)

</trial>

<block myblock>
/ onblockbegin = [
values.lastresponse = "";
]
/trials = [
1-5 = room1
]

</block>



By troyh - 2/4/2021

Ahh! Specifying the options tripped me up! 

Many thanks Dave.