Group: Administrators
Posts: 13K,
Visits: 104K
|
> In summary, I currently have to randomise the presentation of : 2 face stimuli (face 1, face 2), 2 gaze directions (left, right), 2 targets (A, B) > and 2 SOAs (300ms, 700ms)
You can encode all the combinations you need of the above factors using <list> elements. You have a total of 32 combinations:
2(face1,face2) * 2(gazeleft, gazeright) * 2(targeta, targetb) * 2(targetpositionleft, targetpositionright) * 2(targetsoa300, targetsoa700) = 32
You can then sample the applicable combination from those lists /ontrialbegin and select items, etc. accordingly.
1 = face 1; 2 = face 2; <list facetype> / items = (1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2) / selectionmode = random </list>
1 = face 1 left gaze; 2 = face 1 right gaze; 3 = face 2 left gaze; 4 = face 2 right gaze; <list gazedirection> / items = (1,1,1,1,1,1,1,1, 2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3, 4,4,4,4,4,4,4,4) / selectionmode = list.facetype.currentindex </list>
1 = target A; 2 = target B; <list targettype> / items = (1,1,1,1,2,2,2,2, 1,1,1,1,2,2,2,2, 1,1,1,1,2,2,2,2, 1,1,1,1,2,2,2,2) / selectionmode = list.facetype.currentindex </list>
25% = left target position; 75% = right target position; <list targetposition> / items = (25%,25%,75%,75%,25%,25%,75%,75%, 25%,25%,75%,75%,25%,25%,75%,75%, 25%,25%,75%,75%,25%,25%,75%,75%, 25%,25%,75%,75%,25%,25%,75%,75%) / selectionmode = list.facetype.currentindex </list>
300 = short target soa; 700 = long target soa; <list targetsoa> / items = (300,700,300,700,300,700,300,700, 300,700,300,700,300,700,300,700, 300,700,300,700,300,700,300,700, 300,700,300,700,300,700,300,700) / selectionmode = list.facetype.currentindex </list>
<values> / facetype = 1 / gazedirection = 1 / targettype = 1 / targetposition = 0% / targetsoa = 0 </values>
<block myblock> / trials = [1-32 = mytrial] </block>
<trial mytrial> / ontrialbegin = [values.facetype = list.facetype.nextvalue; values.gazedirection = list.gazedirection.nextvalue; values.targettype = list.targettype.nextvalue; values.targetposition = list.targetposition.nextvalue; values.targetsoa = list.targetsoa.nextvalue; ] / ontrialbegin = [trial.mytrial.insertstimulustime(text.target, 1100 + values.targetsoa)] / ontrialend = [trial.mytrial.resetstimulusframes(); ] /stimulustimes = [1=fixation, target_placeholder_left, target_placeholder_right; 500=erase_fixation, direct_face; 1100=averted_face] / validresponse = (57) </trial>
<text fixation> / items = ("+") / size = (10%, 10%) / position = (50%, 50%) / vjustify = center </text>
<shape erase_fixation> / shape = rectangle / color = white / size = (10%, 10%) / position = (50%, 50%) </shape>
<shape target_placeholder_left> / shape = rectangle / color = blue / size = (20%, 30%) / position = (25%, 50%) </shape>
<shape target_placeholder_right> / shape = rectangle / color = blue / size = (20%, 30%) / position = (75%, 50%) </shape>
<text direct_face> / items = direct_face_items / select = values.facetype / position = (50%, 25%) / size = (25%, 40%) / txbgcolor = (grey) </text>
<item averted_face_items> / 1 = "Face1left.jpg" / 2 = "Face1right.jpg" / 3 = "Face2left.jpg" / 4 = "Face2right.jpg" </item>
<text averted_face> / items = averted_face_items / select = values.gazedirection / position = (50%, 25%) / size = (25%, 40%) / txbgcolor = (grey) </text>
<item direct_face_items> / 1 = "Face1direct.jpg" / 2 = "Face2direct.jpg" </item>
<text target> / items = target_items / select = values.targettype / hposition = values.targetposition / vposition = 50% </text>
<item target_items> / 1 = "A" / 2 = "B" </item>
<data> / columns = [date, time, subject, group, blocknum, blockcode, trialnum, trialcode, latency, response, correct, values.facetype, values.gazedirection, values.targettype, values.targetposition, values.targetsoa ] / separatefiles = true </data>
Note: The above example uses <text> elements instead of <picture> elements so you can run it without needing any additional files. Everything works the same when using <picture> elements. I've also focused solely on your selection question and have thus left out some other parts of your code for the sake of brevity.
> (a) ...making sure that each stimuli (or in this case, direct gaze face) is linked to a subsequent stimuli (averted gaze face) for each trial
Is already covered in the above. For general information see the "How to present stimulus pairs" topic in the documentation.
> (b) ...that certain elements (i.e. the placeholders) remain on the screen as others change
Once a stimulus is drawn to the screen, it remains on screen until the end of the trial (unless you overwrite it with another stimulus during the course of the trial). You'll also see that in action when running the above example code. For general information see the "How to erase stimuli" topic in the documentation.
|
Group: Forum Members
Posts: 6,
Visits: 53
|
Hi everyone! I'm pretty new to Inquisit and was hoping I could get some help with an experiment I'm trying to put together. It's a standard gaze cue & spatial task in which the sequence of stimuli would be as follows: (1) Fixation cross with left and right placeholders (remains on the screen for 500ms) (2) Image of Face 1 - direct gaze appears (with left and right placeholders remaining on screen)(remains on the screen for 600ms) (3) Image of Face 1 - averted gaze appears (with left and right placeholders remaining on screen) (4) One of two targets appears in either the left or right placeholders (5) Participants to respond by identifying targets presented In summary, I currently have to randomise the presentation of : 2 face stimuli (face 1, face 2), 2 gaze directions (left, right), 2 targets (A, B) and 2 SOAs (300ms, 700ms) So far, I've coded each stimuli combination individually and have all the trials randomise themselves : For example, for the combination - Face 1 - gaze right - target A - target to appear on the right - SOA 700ms - I've coded it as such (with added conditions for the response and what data gets logged): <trial face1_rightgaze_rightx> /trialcode = "face1_rightgaze_rightx"
/stimulustimes = [1=fixation, target_placeholder_left, target_placeholder_right; 500=direct_face_1, target_placeholder_left, target_placeholder_right; 1100=rightgaze_face_1, target_placeholder_left, target_placeholder_right; 1800=rightgaze_face_1, target_placeholder_left, x_target_right] /beginresponsetime = 1800 /inputdevice=keyboard
/isvalidresponse=[trial.face1_rightgaze_rightx.response == values.responsekey1 || trial.face1_rightgaze_rightx.response == values.responsekey2] /monkeyresponse=(30,38) /iscorrectresponse=[trial.face1_rightgaze_rightx.beginresponsetime < values.trialduration && trial.face1_rightgaze_rightx.response == values.responsekey1]
/ontrialend = [if (trial.face1_rightgaze_rightx.correct) {values.face1rightgazerightx_countcorr += 1; values.sumrt_face1rightgazerightx += trial.face1_rightgaze_rightx.latency}
else {values.face1rightgazerightx_counterr += 1}]
/recorddata = true </trial>
<block block1> /trials = [1-10=noreplace(face1_rightgaze_rightx, face1_rightgaze_leftx)] /onblockend = [values.face1rightgazerightx_countcorr = 0; values.face1rightgazerightx_counterr = 0; values.face1rightgazeleftx_countcorr = 0; values.face1rightgazeleftx_counterr = 0] </block>
I was wondering if there are simpler ways to randomise a set of stimuli like this while... (a) ...making sure that each stimuli (or in this case, direct gaze face) is linked to a subsequent stimuli ( averted gaze face) for each trial (b) ...that certain elements (i.e. the placeholders) remain on the screen as others change I've also tried using the setstimulustimes function in this manner but got stuck when it came to linking the faces together. Any help would be greatly appreciated! Thanks in advance!
|