Millisecond Forums

showing the same item on two trials

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

By JuliaNo - 2/15/2017

In this part of my script, people should see initials (from a list of initials)  on the right side of the screen and at the same time the question "How many tokens do you want to give to [initials]?" However, my script now shows the initials in the question that were displayed on the frame before on the right corner. I know the problem lies here:

<text tokensV2>
/ items = ("How many tokens do you want to give to <% getItem(item.InitialsPlayerB,text.InitialsPlayerB.currentvalue) %>?")
/ position = (50,45)
</text>
However, I am not sure what I should put in there to make it work.


Here is the rest of the code in this part:

<text V2Instructions>
/ items = ("The real game starts now.")
/ halign = center
</text>

<text SpaceToStart>
/ items = ("Press Space to start")
/ position = (50,80)
/ fontstyle = ("Calibri", 2.08%, false, true, false, false, 5, 1)
</text>

<trial V2StartingExperiment>
/stimulusframes = [1= V2Instructions, SpaceToStart]
/ validresponse = (" ")
</trial>

<item InitialsPlayerB>
/1 = "D.K."
/2 = "E.J."
/3 = "A.K."
/4 = "L.B."
/5 = "M.N."
/6 = "F.S."
/7 = "J.M."
/8 = "K.A."
/9 = "R.B."
/10 = "S.F."
/11 = "J.W."
/12 = "T.H."
/13 = "A.S."
/14 = "T.G."
/15 = "E.B."
/16 = "S.P."
/17 = "R.D."
/18 = "E.P."
</item>

<text InitialsPlayerB>
/ items = InitialsPlayerB
/ select = noreplace
/ position = (80,10)
/ font = ("Calibri", -20, 700, 0, 49)
/ fontstyle = ("Calibri", 5%)
</text>

<item FlagB>
/1 = "stimulusMaterial/Flag_of_Portugal.png"
/2= "stimulusMaterial/Flag_of_Portugal.png"
/3= "stimulusMaterial/Flag_of_Portugal.png"
/4= "stimulusMaterial/Flag_of_Portugal.png"
/5= "stimulusMaterial/Flag_of_Portugal.png"
/6= "stimulusMaterial/Flag_of_Portugal.png"
/7= "stimulusMaterial/Flag_of_Portugal.png"
/8= "stimulusMaterial/Flag_of_Portugal.png"
/9= "stimulusMaterial/Flag_of_Portugal.png"
/10 = "stimulusMaterial/Flag_of_Germany.png"
/11 = "stimulusMaterial/Flag_of_Germany.png"
/12 = "stimulusMaterial/Flag_of_Germany.png"
/13 = "stimulusMaterial/Flag_of_Germany.png"
/14 = "stimulusMaterial/Flag_of_Germany.png"
/15 = "stimulusMaterial/Flag_of_Germany.png"
/16 = "stimulusMaterial/Flag_of_Germany.png"
/17 = "stimulusMaterial/Flag_of_Germany.png"
/18 = "stimulusMaterial/Flag_of_Germany.png"
</item>

<picture FlagB>
/ items = FlagB
/ position = (80, 20)
/ size = (90,60)
/ select =noreplace
</picture>

<text tokensV2>
/ items = ("How many tokens do you want to give to <% getItem(item.InitialsPlayerB,text.InitialsPlayerB.currentvalue) %>?")
/ position = (50,45)
</text>

<trial TokensGivenV2>
/ stimulusframes = [1=line, 00, 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, instruTokens,tokensV2,InitialsPlayerB,FlagB, OwnInitials, OwnFlag]
/ inputdevice = mouse
/ validresponse = (00, 01, 02, 03, 04, 05, 06, 07, 08, 09, 10)
</trial>

<text ScoreSummaryText>
/items = ("This is the end of the game.
Press space to see your score and a summary of all answers.")
/ halign = center
</text>

<text EndScoreParticipant>
/items = ("Your score is>.
~n~n~n~nPress space to continue")
/ halign = center
</text>

<trial ScoreSummary>
/stimulusframes = [1= ScoreSummaryText]
/ validresponse = (" ")
</trial>

<trial EndScoreParticipant>
/stimulusframes = [1= EndScoreParticipant]
/ validresponse = (" ")
</trial>

<block PrisonersDilemmaV2>
/ trials = [1 = V2StartingExperiment; 2-19 = TokensGivenV2; 20=ScoreSummary, EndScoreParticipant]
</block>
By Dave - 2/15/2017

JuliaNo - Wednesday, February 15, 2017
In this part of my script, people should see initials (from a list of initials)  on the right side of the screen and at the same time the question "How many tokens do you want to give to [initials]?" However, my script now shows the initials in the question that were displayed on the frame before on the right corner. I know the problem lies here:

<text tokensV2>
/ items = ("How many tokens do you want to give to <% getItem(item.InitialsPlayerB,text.InitialsPlayerB.currentvalue) %>?")
/ position = (50,45)
</text>
However, I am not sure what I should put in there to make it work.


Here is the rest of the code in this part:

<text V2Instructions>
/ items = ("The real game starts now.")
/ halign = center
</text>

<text SpaceToStart>
/ items = ("Press Space to start")
/ position = (50,80)
/ fontstyle = ("Calibri", 2.08%, false, true, false, false, 5, 1)
</text>

<trial V2StartingExperiment>
/stimulusframes = [1= V2Instructions, SpaceToStart]
/ validresponse = (" ")
</trial>

<item InitialsPlayerB>
/1 = "D.K."
/2 = "E.J."
/3 = "A.K."
/4 = "L.B."
/5 = "M.N."
/6 = "F.S."
/7 = "J.M."
/8 = "K.A."
/9 = "R.B."
/10 = "S.F."
/11 = "J.W."
/12 = "T.H."
/13 = "A.S."
/14 = "T.G."
/15 = "E.B."
/16 = "S.P."
/17 = "R.D."
/18 = "E.P."
</item>

<text InitialsPlayerB>
/ items = InitialsPlayerB
/ select = noreplace
/ position = (80,10)
/ font = ("Calibri", -20, 700, 0, 49)
/ fontstyle = ("Calibri", 5%)
</text>

<item FlagB>
/1 = "stimulusMaterial/Flag_of_Portugal.png"
/2= "stimulusMaterial/Flag_of_Portugal.png"
/3= "stimulusMaterial/Flag_of_Portugal.png"
/4= "stimulusMaterial/Flag_of_Portugal.png"
/5= "stimulusMaterial/Flag_of_Portugal.png"
/6= "stimulusMaterial/Flag_of_Portugal.png"
/7= "stimulusMaterial/Flag_of_Portugal.png"
/8= "stimulusMaterial/Flag_of_Portugal.png"
/9= "stimulusMaterial/Flag_of_Portugal.png"
/10 = "stimulusMaterial/Flag_of_Germany.png"
/11 = "stimulusMaterial/Flag_of_Germany.png"
/12 = "stimulusMaterial/Flag_of_Germany.png"
/13 = "stimulusMaterial/Flag_of_Germany.png"
/14 = "stimulusMaterial/Flag_of_Germany.png"
/15 = "stimulusMaterial/Flag_of_Germany.png"
/16 = "stimulusMaterial/Flag_of_Germany.png"
/17 = "stimulusMaterial/Flag_of_Germany.png"
/18 = "stimulusMaterial/Flag_of_Germany.png"
</item>

<picture FlagB>
/ items = FlagB
/ position = (80, 20)
/ size = (90,60)
/ select =noreplace
</picture>

<text tokensV2>
/ items = ("How many tokens do you want to give to <% getItem(item.InitialsPlayerB,text.InitialsPlayerB.currentvalue) %>?")
/ position = (50,45)
</text>

<trial TokensGivenV2>
/ stimulusframes = [1=line, 00, 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, instruTokens,tokensV2,InitialsPlayerB,FlagB, OwnInitials, OwnFlag]
/ inputdevice = mouse
/ validresponse = (00, 01, 02, 03, 04, 05, 06, 07, 08, 09, 10)
</trial>

<text ScoreSummaryText>
/items = ("This is the end of the game.
Press space to see your score and a summary of all answers.")
/ halign = center
</text>

<text EndScoreParticipant>
/items = ("Your score is>.
~n~n~n~nPress space to continue")
/ halign = center
</text>

<trial ScoreSummary>
/stimulusframes = [1= ScoreSummaryText]
/ validresponse = (" ")
</trial>

<trial EndScoreParticipant>
/stimulusframes = [1= EndScoreParticipant]
/ validresponse = (" ")
</trial>

<block PrisonersDilemmaV2>
/ trials = [1 = V2StartingExperiment; 2-19 = TokensGivenV2; 20=ScoreSummary, EndScoreParticipant]
</block>

<text tokensV2>
/ items = ("How many tokens do you want to give to <% getItem(item.InitialsPlayerB,text.InitialsPlayerB.currentvalue) %>?")
/ position = (50,45)
</text>

this seems circular and will not perform any random selection. It should read e.g.

<text tokensV2>
/ items = ("How many tokens do you want to give to <% text.initialsplayerb.item(text.InitialsPlayerB.nextindex) %>?")
/ position = (50,45)
</text>
By JuliaNo - 2/22/2017


Thank you. I have a follow-up question. I decided that I want people to use the same initials in two trials right after each other. So people will first see the information "in this round, Player B is <initials>" and then they see the TokensGivenV2 trials.

So my block would look like this:
<block PrisonersDilemmaV2>
/ trials = [1 = V2StartingExperiment; 2,4,6,8,10,12,14,16,18 = PreScreenPlayerB; 3,5,7,9,11,13,15,17,19 = TokensGivenV2; 20=ScoreSummary, EndScoreParticipant]
</block>

On the "PreScreenPlayerB" trials they should see the same initials as on the following "TokensGivenV2" trials. Is it possible to refer to the same item in two trials with a similar function as the one above? So something like:

<text NextPlayerB>
/ items = ("In the next round, Player B is ~n<% text.initialsplayerb.item(text.InitialsPlayerB.nextindex) %>.")
/ position = (50,45)
</text>

<trial PreScreenPlayerB>
/stimulusframes = [1= NextPlayerB, FlagB]
/timeout = 500
</trial>

(obviously this doesn't work) Or would I have to use a work-around such as randomly picking one of the "PlayerB" items for the first trial (PreScreenPlayerB), assigning that to a value (is that even possible with text, or only with integers?) and then referring to that value variable in the second trial (TokensGivenV2)?

I hope the question is clear.
By Dave - 2/22/2017

JuliaNo - Wednesday, February 22, 2017

Thank you. I have a follow-up question. I decided that I want people to use the same initials in two trials right after each other. So people will first see the information "in this round, Player B is <initials>" and then they see the TokensGivenV2 trials.

So my block would look like this:
<block PrisonersDilemmaV2>
/ trials = [1 = V2StartingExperiment; 2,4,6,8,10,12,14,16,18 = PreScreenPlayerB; 3,5,7,9,11,13,15,17,19 = TokensGivenV2; 20=ScoreSummary, EndScoreParticipant]
</block>

On the "PreScreenPlayerB" trials they should see the same initials as on the following "TokensGivenV2" trials. Is it possible to refer to the same item in two trials with a similar function as the one above? So something like:

<text NextPlayerB>
/ items = ("In the next round, Player B is ~n<% text.initialsplayerb.item(text.InitialsPlayerB.nextindex) %>.")
/ position = (50,45)
</text>

<trial PreScreenPlayerB>
/stimulusframes = [1= NextPlayerB, FlagB]
/timeout = 500
</trial>

(obviously this doesn't work) Or would I have to use a work-around such as randomly picking one of the "PlayerB" items for the first trial (PreScreenPlayerB), assigning that to a value (is that even possible with text, or only with integers?) and then referring to that value variable in the second trial (TokensGivenV2)?

I hope the question is clear.

If you don't want to perform a new selection, use

text.initialsplayerb.item(text.InitialsPlayerB.currentindex)

<item InitialsPlayerB>
/1 = "D.K."
/2 = "E.J."
/3 = "A.K."
/4 = "L.B."
/5 = "M.N."
/6 = "F.S."
/7 = "J.M."
/8 = "K.A."
/9 = "R.B."
/10 = "S.F."
/11 = "J.W."
/12 = "T.H."
/13 = "A.S."
/14 = "T.G."
/15 = "E.B."
/16 = "S.P."
/17 = "R.D."
/18 = "E.P."
</item>

<text InitialsPlayerB>
/ items = InitialsPlayerB
/ select = noreplace
/ position = (80,10)
/ font = ("Calibri", -20, 700, 0, 49)
/ fontstyle = ("Calibri", 5%)
</text>

<trial PreScreenPlayerB>
/stimulusframes = [1=NextPlayerB]
/timeout = 500
</trial>

<text NextPlayerB>
/ items = ("In the next round, Player B is ~n<% text.initialsplayerb.item(text.InitialsPlayerB.nextindex) %>.")
/ position = (50,45)
</text>

<trial TokensGivenV2>
/ stimulusframes = [1=tokensV2]
/ validresponse = (57)
</trial>

<text tokensV2>
/ items = ("How many tokens do you want to give to <% text.initialsplayerb.item(text.InitialsPlayerB.currentindex) %>?")
/ position = (50,45)
</text>

<block myblock>
/ trials = [1-4 = sequence(prescreenplayerb, TokensGivenV2)]
</block>