trying to write if statements between a block and trials


Author
Message
Amateur_needing_help
Amateur_needing_help
Associate Member (64 reputation)Associate Member (64 reputation)Associate Member (64 reputation)Associate Member (64 reputation)Associate Member (64 reputation)Associate Member (64 reputation)Associate Member (64 reputation)Associate Member (64 reputation)Associate Member (64 reputation)
Group: Forum Members
Posts: 1, Visits: 30
Hi,
I am trying to write a within-subjects experiment on effort justification. where subjects either press the keyboard 20 times or 1 time to produce a set of abstract shapes. If they told to press the spacebar 20 times (high effort) they need to see either 1picR and 2picL, 1picL and 2picR, 3picL and 4picR or 3picR and 4picL. If they are randomly told to press the spacebar 1 time they need to see either 5picR and 6picL, 5picL and 6picR, 7picR and 8picL or 7picR and 8picL. I have been unable to make these pairing occur because of the complicated nature of the code for the spacebar presses being in their own block. Can anyone provide some advice on how to do an appropriate if statement or to change the spacebar presses block into a trial so that I can write a new block connecting the presses to certain shapes.
Thank you in advance- any comments are much appreciated!
All the relevant coding is below:


<item 1picR>
/1 = "he1.jpg"
</item>

<item 1picL>
/1 = "he1.jpg"
</item>

<item 2picL>
/1 = "he2.jpg"
</item>

<item 2picR>
/1 = "he2.jpg"
</item>

<item 3picR>
/1 = "he3.jpg"
</item>

<item 3picL>
/1 = "he3.jpg"
</item>

<item 4picL>
/1 = "he4.jpg"
</item>

<item 4picR>
/1 = "he4.jpg"
</item>

<item 5picR>
/1 = "le1.jpg"
</item>

<item 5picL>
/1 = "le1.jpg"
</item>

<item 6picL>
/1 = "le2.jpg"
</item>

<item 6picR>
/1 = "le2.jpg"
</item>


<item 7picR>
/1 = "le3.jpg"
</item>

<item 7picL>
/1 = "le3.jpg"
</item>

<item 8picL>
/1 = "le4.jpg"
</item>


<item 8picR>
/1 = "le4.jpg"
</item>

<item spacebarhard>
/1 = "please press the spacebar 20 times"
</item>

<item spacebareasy>
/1 = "please press the spacebar 1 time"
</item>


<values>
/ spacebarpresscount = 0
</values>

<trial 1picR>
/ validresponse = ("E", "I")
/ correctresponse = ("I")
/ stimulusframes = [1 = 1picR, 2picL]
</trial>

<trial 1picL>
/ validresponse = ("E", "I")
/ correctresponse = ("E")
/ stimulusframes = [1 = 1picL, 2picR]
</trial>

<trial 3picR>
/ validresponse = ("E", "I")
/ correctresponse = ("I")
/ stimulusframes = [1 = 3picR, 4picL]
</trial>

<trial 3picL>
/ validresponse = ("E", "I")
/ correctresponse = ("E")
/ stimulusframes = [1 = 3picL, 4picR]
</trial>

<trial 5picR>
/ validresponse = ("E", "I")
/ correctresponse = ("I")
/ stimulusframes = [1 = 5picR, 6picL]
</trial>

<trial 5picL>
/ validresponse = ("E", "I")
/ correctresponse = ("E")
/ stimulusframes = [1 = 5picL, 6picR]
</trial>

<trial 7picR>
/ validresponse = ("E", "I")
/ correctresponse = ("I")
/ stimulusframes = [1 = 7picR, 8picL]
</trial>

<trial 7picL>
/ validresponse = ("E", "I")
/ correctresponse = ("E")
/ stimulusframes = [1 = 7picL, 8picR]
</trial>

//spacebartrials
<values>
/responsekeyhard = 0
/responsekeyeasy = 0
</values>

<trial responsekey_hard>
/validresponse = (57)
if (trial.response == 57) values.responsekeyhard += 1
</trial>

<trial responsekey_easy>
/validresponse = (57)
if (trial.response == 57) values.responsekeyeasy += 1
</trial>

<block spacebarhard>
/ bgstim = (spacebarhard)
/ trials = [1-20=responsekey_hard]
/ stop=[values.responsekeyhard >= 20]
</block>

<block spacebareasy>
/bgstim = (spacebareasy)
/ trials = [1=responsekey_easy]
/ stop=[values.responsekeyeasy >= 1]
</block>

<block A>
/ bgstim = (pressreminder)
/ trials = [1-16 = random(1picR,3picR,5picR,7picR,1picL,3picL,5picL,7picL,1picR,3picR,5picR,7picR,1picL,3picL,5picL,7picL)]
/ correctmessage = true(correctlabel,500)
/ errormessage = true(errorlabel,500)
</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: 12K, Visits: 98K
Amateur_needing_help - 6/16/2019
Hi,
I am trying to write a within-subjects experiment on effort justification. where subjects either press the keyboard 20 times or 1 time to produce a set of abstract shapes. If they told to press the spacebar 20 times (high effort) they need to see either 1picR and 2picL, 1picL and 2picR, 3picL and 4picR or 3picR and 4picL. If they are randomly told to press the spacebar 1 time they need to see either 5picR and 6picL, 5picL and 6picR, 7picR and 8picL or 7picR and 8picL. I have been unable to make these pairing occur because of the complicated nature of the code for the spacebar presses being in their own block. Can anyone provide some advice on how to do an appropriate if statement or to change the spacebar presses block into a trial so that I can write a new block connecting the presses to certain shapes.
Thank you in advance- any comments are much appreciated!
All the relevant coding is below:


<item 1picR>
/1 = "he1.jpg"
</item>

<item 1picL>
/1 = "he1.jpg"
</item>

<item 2picL>
/1 = "he2.jpg"
</item>

<item 2picR>
/1 = "he2.jpg"
</item>

<item 3picR>
/1 = "he3.jpg"
</item>

<item 3picL>
/1 = "he3.jpg"
</item>

<item 4picL>
/1 = "he4.jpg"
</item>

<item 4picR>
/1 = "he4.jpg"
</item>

<item 5picR>
/1 = "le1.jpg"
</item>

<item 5picL>
/1 = "le1.jpg"
</item>

<item 6picL>
/1 = "le2.jpg"
</item>

<item 6picR>
/1 = "le2.jpg"
</item>


<item 7picR>
/1 = "le3.jpg"
</item>

<item 7picL>
/1 = "le3.jpg"
</item>

<item 8picL>
/1 = "le4.jpg"
</item>


<item 8picR>
/1 = "le4.jpg"
</item>

<item spacebarhard>
/1 = "please press the spacebar 20 times"
</item>

<item spacebareasy>
/1 = "please press the spacebar 1 time"
</item>


<values>
/ spacebarpresscount = 0
</values>

<trial 1picR>
/ validresponse = ("E", "I")
/ correctresponse = ("I")
/ stimulusframes = [1 = 1picR, 2picL]
</trial>

<trial 1picL>
/ validresponse = ("E", "I")
/ correctresponse = ("E")
/ stimulusframes = [1 = 1picL, 2picR]
</trial>

<trial 3picR>
/ validresponse = ("E", "I")
/ correctresponse = ("I")
/ stimulusframes = [1 = 3picR, 4picL]
</trial>

<trial 3picL>
/ validresponse = ("E", "I")
/ correctresponse = ("E")
/ stimulusframes = [1 = 3picL, 4picR]
</trial>

<trial 5picR>
/ validresponse = ("E", "I")
/ correctresponse = ("I")
/ stimulusframes = [1 = 5picR, 6picL]
</trial>

<trial 5picL>
/ validresponse = ("E", "I")
/ correctresponse = ("E")
/ stimulusframes = [1 = 5picL, 6picR]
</trial>

<trial 7picR>
/ validresponse = ("E", "I")
/ correctresponse = ("I")
/ stimulusframes = [1 = 7picR, 8picL]
</trial>

<trial 7picL>
/ validresponse = ("E", "I")
/ correctresponse = ("E")
/ stimulusframes = [1 = 7picL, 8picR]
</trial>

//spacebartrials
<values>
/responsekeyhard = 0
/responsekeyeasy = 0
</values>

<trial responsekey_hard>
/validresponse = (57)
if (trial.response == 57) values.responsekeyhard += 1
</trial>

<trial responsekey_easy>
/validresponse = (57)
if (trial.response == 57) values.responsekeyeasy += 1
</trial>

<block spacebarhard>
/ bgstim = (spacebarhard)
/ trials = [1-20=responsekey_hard]
/ stop=[values.responsekeyhard >= 20]
</block>

<block spacebareasy>
/bgstim = (spacebareasy)
/ trials = [1=responsekey_easy]
/ stop=[values.responsekeyeasy >= 1]
</block>

<block A>
/ bgstim = (pressreminder)
/ trials = [1-16 = random(1picR,3picR,5picR,7picR,1picL,3picL,5picL,7picL,1picR,3picR,5picR,7picR,1picL,3picL,5picL,7picL)]
/ correctmessage = true(correctlabel,500)
/ errormessage = true(errorlabel,500)
</block>



Why don't you simply /branch from <block spacebarhard> to a <block> that runs one of the "high effort"  trials, and /branch from <block spacebareasy> to a <block> that runs one of the low effort trials?

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search