By Hannah_Razak - 8/16/2016
Hi everyone!
I'm trying to set up a visual search task and would greatly appreciate some help with a few codes.
The sequence of events for the task are :
(1st screen) Fixation (2nd screen) Presentation of a target within a randomized array consisting of 2,4 or 8 items & items remain on screen until participants respond "Yes" or "No" to having seen a target by pressing one of two keys on the keyboard (3rd screen) Participants prompted to identify the previous location of the target - by having the exact same array presented in the 2nd screen appear with simply blank boxes
I have gotten everything else running perfectly well but I am having some troubles getting the right code for the 3rd screen - that is to get the 3rd screen to present the exact same array that was presented in the previous screen.
If it helps, I have included the codes I have for my sequence of trials.
I would absolutely value any help if anyone has set up a visual search task similar to this before.
Thanks in advance!
Codes:
(1st screen - FIXATION)
<trial fixation> /stimulusframes = [1 = fixation] /timeout = values.fixationduration /branch = [if (values.expcondition == 0) {values.setsize = 8; trial.targetpresent8}] /branch = [if (values.expcondition == 0) {values.setsize = 8; trial.targetabsent8}] /recorddata = false /errormessage = false </trial>
(2nd screen - TARGET PRESENTED IN ARRAY)
<trial targetpresent8> /ontrialbegin = [values.trialtype = "targetpresent"] /ontrialbegin = [values.selectdistractor7 = list.distractor_itemnumber.nextindex]
/ontrialbegin = [values.stimulilocations = concat(values.stimulilocations, "Distractor1: ")] /ontrialbegin = [values.stimulilocations = concat(values.stimulilocations, values.selectdistractor1)] /ontrialbegin = [values.distractor_x1 = expressions.xcenter + list.x_coordinates_pictures.nextvalue] /ontrialbegin = [values.distractor_y1 = expressions.ycenter + list.y_coordinates_pictures.nextvalue] /ontrialbegin = [values.pictureposition = list.pictureposition.nextvalue] /ontrialbegin = [values.stimulilocations = concat(values.stimulilocations, ", Position: ")] /ontrialbegin = [values.stimulilocations = concat(values.stimulilocations, values.pictureposition)]
/ontrialbegin = [values.stimulilocations = concat(values.stimulilocations, ", Distractor2: ")] /ontrialbegin = [values.stimulilocations = concat(values.stimulilocations, values.selectdistractor2)] /ontrialbegin = [values.distractor_x2 = expressions.xcenter + list.x_coordinates_pictures.nextvalue] /ontrialbegin = [values.distractor_y2 = expressions.ycenter + list.y_coordinates_pictures.nextvalue] /ontrialbegin = [values.pictureposition = list.pictureposition.nextvalue] /ontrialbegin = [values.stimulilocations = concat(values.stimulilocations, ", Position: ")] /ontrialbegin = [values.stimulilocations = concat(values.stimulilocations, values.pictureposition)]
/ontrialbegin = [values.stimulilocations = concat(values.stimulilocations, ", Distractor3: ")] /ontrialbegin = [values.stimulilocations = concat(values.stimulilocations, values.selectdistractor3)] /ontrialbegin = [values.distractor_x3 = expressions.xcenter + list.x_coordinates_pictures.nextvalue] /ontrialbegin = [values.distractor_y3 = expressions.ycenter + list.y_coordinates_pictures.nextvalue] /ontrialbegin = [values.pictureposition = list.pictureposition.nextvalue] /ontrialbegin = [values.stimulilocations = concat(values.stimulilocations, ", Position: ")] /ontrialbegin = [values.stimulilocations = concat(values.stimulilocations, values.pictureposition)]
/ontrialbegin = [values.stimulilocations = concat(values.stimulilocations, ", Distractor4: ")] /ontrialbegin = [values.stimulilocations = concat(values.stimulilocations, values.selectdistractor4)] /ontrialbegin = [values.distractor_x4 = expressions.xcenter + list.x_coordinates_pictures.nextvalue] /ontrialbegin = [values.distractor_y4 = expressions.ycenter + list.y_coordinates_pictures.nextvalue] /ontrialbegin = [values.pictureposition = list.pictureposition.nextvalue] /ontrialbegin = [values.stimulilocations = concat(values.stimulilocations, ", Position: ")] /ontrialbegin = [values.stimulilocations = concat(values.stimulilocations, values.pictureposition)]
/ontrialbegin = [values.stimulilocations = concat(values.stimulilocations, ", Distractor5: ")] /ontrialbegin = [values.stimulilocations = concat(values.stimulilocations, values.selectdistractor5)] /ontrialbegin = [values.distractor_x5 = expressions.xcenter + list.x_coordinates_pictures.nextvalue] /ontrialbegin = [values.distractor_y5 = expressions.ycenter + list.y_coordinates_pictures.nextvalue] /ontrialbegin = [values.pictureposition = list.pictureposition.nextvalue] /ontrialbegin = [values.stimulilocations = concat(values.stimulilocations, ", Position: ")] /ontrialbegin = [values.stimulilocations = concat(values.stimulilocations, values.pictureposition)]
/ontrialbegin = [values.stimulilocations = concat(values.stimulilocations, ", Distractor6: ")] /ontrialbegin = [values.stimulilocations = concat(values.stimulilocations, values.selectdistractor6)] /ontrialbegin = [values.distractor_x6 = expressions.xcenter + list.x_coordinates_pictures.nextvalue] /ontrialbegin = [values.distractor_y6 = expressions.ycenter + list.y_coordinates_pictures.nextvalue] /ontrialbegin = [values.pictureposition = list.pictureposition.nextvalue] /ontrialbegin = [values.stimulilocations = concat(values.stimulilocations, ", Position: ")] /ontrialbegin = [values.stimulilocations = concat(values.stimulilocations, values.pictureposition)]
/ontrialbegin = [values.stimulilocations = concat(values.stimulilocations, ", Distractor7: ")] /ontrialbegin = [values.stimulilocations = concat(values.stimulilocations, values.selectdistractor7)] /ontrialbegin = [values.distractor_x7 = expressions.xcenter + list.x_coordinates_pictures.nextvalue] /ontrialbegin = [values.distractor_y7 = expressions.ycenter + list.y_coordinates_pictures.nextvalue] /ontrialbegin = [values.pictureposition = list.pictureposition.nextvalue] /ontrialbegin = [values.stimulilocations = concat(values.stimulilocations, ", Position: ")] /ontrialbegin = [values.stimulilocations = concat(values.stimulilocations, values.pictureposition)]
/ontrialbegin = [values.stimulilocations = concat(values.stimulilocations, ", Target: ")] /ontrialbegin= [values.stimulilocations = concat(values.stimulilocations, picture.target.currentitemnumber)] /ontrialbegin = [values.target = picture.target.currentitem]
/ontrialbegin = [values.pictureposition = list.pictureposition.nextvalue] /ontrialbegin= [values.stimulilocations = concat(values.stimulilocations, ", Position: ")] /ontrialbegin = [values.stimulilocations = concat(values.stimulilocations, values.pictureposition)]
/ontrialbegin = [values.target_x = expressions.xcenter + list.x_coordinates_pictures.nextvalue] /ontrialbegin = [values.target_y = expressions.ycenter + list.y_coordinates_pictures.nextvalue]
/stimulusframes = [1 = fixation, distractor1, distractor2, distractor3, distractor4, distractor5, distractor6, distractor7, target]
/isvalidresponse = [trial.targetpresent8.response == values.responsekey_targetabsent || trial.targetpresent8.response == values.responsekey_targetpresent] /iscorrectresponse = [trial.targetpresent8.response == values.responsekey_targetpresent]
/monkeyresponse = (21, 49) /ontrialend = [if (trial.targetpresent8.correct) {values.hit = 1; values.responsetype = "Hit"} else {values.miss = 1; values.responsetype = "Miss"}] /branch = [trial.targetlocation]
</trial>
I have also included "target absent" trials as catch trials with very similar codes - for example - the only difference to the above code is that 8 distractors are selected to be presented rather that 7
(3rd screen - TARGET LOCATION)
<trial targetlocation>
/stimulusframes = [1 = targetlocationinstructions] /isvalidresponse = [trial.targetlocation.response == values.responsekey_targetlocationup || trial.targetlocation.response == values.responsekey_targetlocationdown] /monkeyresponse = (72, 80) /iscorrectresponse = [trial.targetlocation.response == values.responsekey_targetlocationup || trial.targetlocation.response == values.responsekey_targetlocationdown]
/ontrialend = [if (trial.targetlocation.correct) {values.hit = 1; values.responsetype = "Location Recorded"} else {values.miss = 1; values.responsetype = "No Location Recorded"}]
/ontrialend = [if (trial.targetpresent8.correct && (values.pictureposition == 1 || values.pictureposition == 2 || values.pictureposition == 3 || values.pictureposition == 8) && values.responsekey_targetlocationup) {values.responsetype = "Correct location identified"} else {values.responsetype = "Incorrect location identified"}] /ontrialend = [if (trial.targetpresent8.correct && (values.pictureposition == 4 || values.pictureposition == 5 || values.pictureposition == 6 || values.pictureposition == 7) && values.responsekey_targetlocationdown) {values.responsetype = "Correct location identified"} else {values.responsetype = "Incorrect location identified"}]
/ontrialend = [if (trial.targetabsent8.correct) {values.responsetype = "No location target absent"}]
/recorddata = true /branch = [trial.end]
Here, I only have a screen asking participants where they thought the location was and to press one of two keys to indicate an "Bottom half" or "Top half" response.
</trial>
|
By Dave - 8/16/2016
The code is somewhat incomplete and thus hard to make sense of. What you should do (and it looks like you already do some of it, how much I can't be sure of):
#1: In <trial targetpresent8> store your stimuli's x and y positions in global variables (<values> entries). Your stimuli should use those values in their respective /hposition and /vposition attributes.
<trial targetpresent8> ... /ontrialbegin = [values.distractor_x1 = expressions.xcenter + list.x_coordinates_pictures.nextvalue] /ontrialbegin = [values.distractor_y1 = expressions.ycenter + list.y_coordinates_pictures.nextvalue] ... /stimulusframes = [1 = fixation, distractor1, distractor2, distractor3, distractor4, distractor5, distractor6, distractor7, target] ... /branch = [trial.targetlocation8] </trial>
with
<picture distractor1> ... / hposition = values.distractor_x1 / vposition = values.distractor_y1 ... </picture>
and so forth. Importantly, you only do that in the "1st screen" trial.
#2: You'll want to set up separate "targetlocation" trials for different numbers of distractors as well as present or absent. I.e., <trial targetlocation8>, <trial targetlocation7>, and so forth. /branch to the appropriate trial from the "targetpresent" or "targetabsent" trial.
#3: Then all you need is to have the respective "targetlocation" trial display the same stimuli again:
<trial targetlocation8> ... /stimulusframes = [1 = targetlocationinstructions, distractor1, distractor2, distractor3, distractor4, distractor5, distractor6, distractor7, target] ... </trial>
The array will be identical to the one displayed in the 1st screen.
|
By Hannah_Razak - 9/6/2016
Hi Dave,
(So sorry for getting replying this late. Got called away from work for the past 2 weeks)
Thanks so much for your reply though! I have that bit sorted for now. The stimuli did have their positions logged (didn't want to chuck in too much here) but it was the issue of having it come up exactly the same in the next page/frame. Thanks again! :)
On another related code, I've set up another similar paradigm but instead of asking people to identify the location of the targets, people will simply view the array and press two keys (yes or no) to indicate if they saw the target.
Basically, each trial follows this sequence : "Ready" ---> Fixation ---> Array of images ---> Array stays on until people respond "yes" or "no" to having seen the target
I have got the program running and data is recorded just fine as well but I do get this message at the end of it :
The element 'mixedcues' in branch expression 'mixedcues' is the wrong element type.
I belive it refers to this bit of code here:
<trial ready> /ontrialbegin = [list.x_coordinates_pictures.reset()] /ontrialbegin = [values.stimulilocations = ""; values.target = ""; values.trialtype = ""] /ontrialbegin = [values.hit = 0; values.miss = 0; values.FA = 0; values.CR = 0] /stimulusframes = [1 = ready] /timeout = values.readyduration /recorddata = false /errormessage = false /branch = [trial.fixation] </trial>
<trial fixation> /stimulusframes = [1 = fixation] /timeout = values.fixationduration /recorddata = false /errormessage = false /branch = [block.mixedcues] </trial>
<block mixedcues> /preinstructions = (cue) /skip = [values.blockedcues == true] /stop = [values.count_sequence == values.trialnumber] /onblockbegin = [values.count_sequence = 0] /onblockbegin = [values.countblocks += 0] /trials = [1-16 = noreplace(targetpresent4distractor1, targetpresent6distractor1, targetpresent8distractor1, targetabsent4distractor1, targetabsent6distractor1, targetabsent8distractor1, targetpresent4distractor2, targetpresent6distractor2, targetpresent8distractor2, targetabsent4distractor2, targetabsent6distractor2, targetabsent8distractor2, targetpresent4distractor3, targetpresent6distractor3, targetpresent8distractor3, targetabsent4distractor3, targetabsent6distractor3, targetabsent8distractor3)] </block>
The codes in blue are the different 18 trial types/specific stimuli arrangements that the task goes through.
Could you let me know what I've done wrong for the error to come up?
Thanks! :)
|
By Dave - 9/6/2016
The reason for the message is this: /branches need to take place at the same "level", i.e., a <trial> may /branch to another <trial>, but not to a <block>. Conversely, a <block> may /branch to another <block>, but not to a <trial>.
<trial fixation> /stimulusframes = [1 = fixation] /timeout = values.fixationduration /recorddata = false /errormessage = false /branch = [block.mixedcues] </trial>
You can't /branch to a <block> from a <trial>, which is what the above aims to do. The /branch needs to either reside at the <block>-level, or you need to /branch to a <trial> instead of a <block>.
|
By Hannah_Razak - 9/12/2016
Got it! Thanks so much for your help Dave. :)
|
|