By ldobb - 4/27/2016
Hi Dave,
I'm having trouble figuring out how to send underperforming subjects to a page that gives them their % accuracy. I've tried onblockend and branch but nothing seems to work. I also want them to pass a capture check, and if they don't, for that to send them to another page. Here are the relevant portions of script:
<block sliderintro> / trials = [1-2 = instructions_1; 3 = milk_slide_pic; 4 = instructions_2] / bgstim = (spacebar) </block>
<block slider> / trials = [ 1-38 = noreplace(capture1, capture2, alc, alc, alc, alc, alc, alc, alc, alc, alc, alc, alc, alc, alc, alc, alc, alc, alc, alc, nonalc, nonalc, nonalc, nonalc, nonalc, nonalc, nonalc, nonalc, nonalc, nonalc, nonalc, nonalc, nonalc, nonalc, nonalc, nonalc, nonalc, nonalc)] / onblockend = [if (values.capture < 4) block.nocapture else block.stimintro] </block>
<block stimintro> / trials = [1 = preinstructions_3; 2 = instructions_3; 3-4 = instructions_3a; 5-6 = instructions_3b; 7-10 = instructions_3c; 11 = probe_practice1; 12 = probe_practice2; 13 = instructions_4] / bgstim = (spacebar) </block>
<block stimuli> / trials = [1-36 = noreplace( alcoholAL, alcoholAL, alcoholAL, alcoholAL, alcoholAR, alcoholAR, alcoholAR, alcoholAR, alcoholAL, alcoholAL, alcoholAL, alcoholAL, alcoholAL, alcoholAR, alcoholAR, alcoholAR, alcoholAR, alcoholAR, alcoholBL, alcoholBL, alcoholBL, alcoholBL, alcoholBR, alcoholBR, alcoholBR, alcoholBR, alcoholBR, alcoholBR, alcoholBL, alcoholBL, alcoholBL, alcoholBL, alcoholBL, alcoholBR, alcoholBR, alcoholBR)] / onblockend = [if (expressions.alc_percent < 75 || expressions.nonalc_percent < 75) block.underaccuracy else block.mturk] </block>
<block nocapture> / trials = [1 = nocapture] </block>
<block underaccuracy> / trials = [1 = underaccuracy] </block>
<block mturk> / trials = [1 = mturk] </block>
<expt> / blocks = [1 = sliderintro; 2 = slider] </expt>
------------------------------------------------- VALUES/EXPR -------------------------------------------------
<values> / probe_alc_pos = 0 / probe_nonalc_pos = 0 / probe_arrow_pos = 0 / probe_alc_rt_sum = 0 / probe_nonalc_rt_sum = 0 / image_cat = 0 / image_name = 0 / alc_enjoy_sum = 0 / alc_want_sum = 0 / alc_num = 0 / alc_rt_sum = 0 / nonalc_enjoy_sum = 0 / nonalc_want_sum = 0 / nonalc_num = 0 / nonalc_rt_sum = 0 / alc_probe_sum = 0 / nonalc_probe_sum = 0 / slider_correct = 0 / capture = 0 </values>
<expressions> / alc_enjoy_meanrating = (values.alc_enjoy_sum/values. alc_num) / alc_want_meanrating = (values.alc_want_sum/values.alc_num) / alc_rating_meanRT = (values.alc_rt_sum/values.alc_num) / nonalc_enjoy_meanrating = (values.nonalc_enjoy_sum/values.nonalc_num) / nonalc_want_meanrating = (values.nonalc_want_sum/values.nonalc_num) / nonalc_rating_meanRT = (values.nonalc_rt_sum/values.nonalc_num) / alc_probe_correct = (values.alc_probe_sum/18) / nonalc_probe_correct = (values.nonalc_probe_sum/18) / alc_probe_meanRT = (values.probe_alc_rt_sum/values.alc_probe_sum) / nonalc_probe_meanRT = (values.probe_nonalc_rt_sum/values.nonalc_probe_sum) / alc_percent = round(expressions.alc_probe_correct*100) / nonalc_percent = round(expressions.nonalc_probe_correct*100) </expressions>
<trial alcoholAL> / posttrialpause = 1000 / stimulustimes = [0 = fixation; 500 = erasefixation, alcoholL_arrowL, nonalcR_arrowL, arrowL; 700 = blankscreen, drink_nonalc, drink_alc] / validresponse = (200, 208) / iscorrectresponse = [(text.drink_alc.vposition == 35% && trial.alcoholAL.response == 200) || (text.drink_alc.vposition == 65% && trial.alcoholAL.response == 208)] / correctmessage = (drink_alc_clicked, 500) / errormessage = (drink_nonalc_clicked, 500) / branch = [if (text.drink_nonalc.vposition == 35% && trial.alcoholAL.response == 200) trial.alcoholAL.error == true] / branch = [if (text.drink_nonalc.vposition == 65% && trial.alcoholAL.response == 208) trial.alcoholAL.error == true] / responsemessage = (0, blankscreen, 100) / timeout = 3700 / ontrialbegin = [values.probe_alc_pos = "L"; values.probe_nonalc_pos = "R"; values.probe_arrow_pos = "L"; values.image_cat = "ALC"; values.image_name = picture.alcoholl_arrowl.currentitem] / ontrialend = [if (trial.alcoholal.correct == true) {values.alc_probe_sum += 1; values.probe_alc_rt_sum += trial.alcoholal.latency;};] </trial>
<trial alc> / stimulustimes = [0 = alc] / validresponse = (0) / trialduration = 3000 / ontrialbegin = [values.image_cat = "ALC"; values.image_name = picture.alc.currentitem] / ontrialend = [values.image_cat = "ALC"; values.image_name = picture.alc.currentitem] / responsetrial = (0, rating) / correctresponse = (0) / beginresponsetime = 3000 </trial>
<trial nonalc> / stimulustimes = [0 = nonalc] / validresponse = (0) / trialduration = 3000 / ontrialbegin = [values.image_cat = "NONALC"; values.image_name = picture.nonalc.currentitem] / ontrialend = [values.image_cat = "NONALC"; values.image_name = picture.nonalc.currentitem] / responsetrial = (0, rating) / correctresponse = (0) / beginresponsetime = 3000 </trial>
<surveypage rating> / questions = [1 = stim_slider_want; 2 = stim_slider_enjoy] / stimulusframes = [1 = slider_q1, slider_l1, slider_r1, slider_remind, slider_q2, slider_l2, slider_r2, slider_remind] / showpagenumbers = false / showquestionnumbers = false / finishlabel = "Submit" / timeout = 10000 / navigationbuttonfontstyle = ("Arial", 2.5%, true) / nextbuttonposition = (46.75%, 85%) / ontrialbegin = [if (values.image_cat == "ALC") {values.image_cat = "ALC"; values.image_name = picture.alc.currentitem}] / ontrialbegin = [if (values.image_cat == "NONALC") {values.image_name = picture.nonalc.currentitem; values.image_cat = "NONALC"}] / ontrialend = [if (slider.stim_slider_want.response == 50 && slider.stim_slider_enjoy.response == 50 && surveypage.rating.latency >= 10000) values.slider_correct = 0 else values.slider_correct = 1] / ontrialend = [if (values.image_cat == "ALC" && values.slider_correct != 0) {values.alc_num += 1; values.alc_enjoy_sum += slider.stim_slider_enjoy.response; values.alc_want_sum += slider.stim_slider_want.response; values.alc_rt_sum += surveypage.rating.latency;};] / ontrialend = [if (values.image_cat == "NONALC" && values.slider_correct != 0) {values.nonalc_num += 1; values.nonalc_enjoy_sum += slider.stim_slider_enjoy.response; values.nonalc_want_sum += slider.stim_slider_want.response; values.nonalc_rt_sum += surveypage.rating.latency;};] / ontrialend = [if (values.image_cat == "ALC") values.image_name = picture.alc.currentitem] / ontrialend = [if (values.image_cat == "NONALC") values.image_name = picture.nonalc.currentitem] / response = timeout (10000) </surveypage>
------------------------------------------------- CAPTURES ------------------------------------------------- <trial capture1> / stimulustimes = [0 = hotchoc_slide_pic] / timeout = 3000 / validresponse = (0) / responsetrial = (0, cap1_surv) </trial>
<surveypage cap1_surv> / questions = [1 = cap1_slider1; 2 = cap1_slider2] / stimulusframes = [1 = cap1_q1, cap1_l1, cap1_r1, slidercap_remind; 2 = cap1_q2, cap1_l2, cap1_r2, slider_remind] / showpagenumbers = false / showquestionnumbers = false / finishlabel = "Submit" / navigationbuttonfontstyle = ("Arial", 2.5%, true) / nextbuttonposition = (46.75%, 85%) / timeout = 10000 / ontrialend = [if (slider.cap1_slider1.response >= 75 || slider.cap1_slider2.response <= 25) values.slider_correct = 1 else values.slider_correct = 0] / ontrialend = [if (slider.cap1_slider1.response >= 75 ) values.capture += 1] / ontrialend = [if (slider.cap1_slider2.response <= 25 ) values.capture += 1] </surveypage>
<slider cap1_slider1> / range = (0, 100) / increment = 1 / slidersize = (80%, 50%) / position= (10%, 35%) / showtooltips = false </slider>
<slider cap1_slider2> / range = (0, 100) / increment = 1 / slidersize = (80%, 50%) / position = (10%, 65%) / showtooltips = false </slider>
<slider cap2_slider1> / range = (0, 100) / increment = 1 / slidersize = (80%, 50%) / position= (10%, 35%) / showtooltips = false </slider>
<slider cap2_slider2> / range = (0, 100) / increment = 1 / slidersize = (80%, 50%) / position = (10%, 65%) / showtooltips = false </slider>
<text slidercap_remind> / items = ("Drag both sliders COMPLETELY to the correct responses, then click SUBMIT.") / hjustify = center / vjustify = center / fontstyle = ("Arial", 4%, true) / position = (50%, 15%) / txcolor = (0, 191, 255) </text>
<text cap1_q1> / items = ("What was shown in the previous image?") / hjustify = center / vjustify = center / fontstyle = ("Arial", 3%, true) / position = (50%, 30%) </text>
<text cap1_l1> / items = ("telephone") / fontstyle = ("Arial", 2.25%, true) / position = (10%, 42%) </text>
<text cap1_r1> / items = ("hot chocolate") / fontstyle = ("Arial", 2.25%, true) / position = (90%, 42%) </text>
<text cap1_q2> / items = ("Are you paying attention to these questions?") / hjustify = center / vjustify = center / fontstyle = ("Arial", 3%, true) / position = (50%, 60%) </text>
<text cap1_l2> / items = ("Yes, I am.") / fontstyle = ("Arial", 2.25%, true) / position = (10%, 71%) </text>
<text cap1_r2> / items = ("No, I am not.") / fontstyle = ("Arial", 2.25%, true) / position = (90%, 71%) </text>
<trial capture2> / stimulustimes = [0 = milk_slide_pic] / timeout = 3000 / validresponse = (0) / branch = [surveypage.cap2_surv] </trial>
<surveypage cap2_surv> / questions = [1 = cap2_slider1; 2 = cap2_slider2] / stimulusframes = [1 = cap1_q1, cap2_l1, cap2_r1, slidercap_remind; 2 = cap1_q2, cap1_l2, cap1_r2, slider_remind] / showpagenumbers = false / showquestionnumbers = false / finishlabel = "Submit" / navigationbuttonfontstyle = ("Arial", 2.5%, true) / nextbuttonposition = (46.75%, 85%) / timeout = 10000 / ontrialend = [if (slider.cap2_slider1.response <= 25 || slider.cap2_slider2.response <= 25) values.slider_correct = 1 else values.slider_correct = 0] / ontrialend = [if (slider.cap2_slider1.response <= 25 ) values.capture += 1] / ontrialend = [if (slider.cap2_slider2.response <= 25 ) values.capture += 1] </surveypage>
<text cap2_l1> / items = ("milk") / fontstyle = ("Arial", 2.25%, true) / position = (10%, 42%) </text>
<text cap2_r1> / items = ("racecar") / fontstyle = ("Arial", 2.25%, true) / position = (90%, 42%) </text> ------------------------------------------------- ACCURACY CHECK ------------------------------------------------- <trial underaccuracy> / stimulusframes = [1=scorereport; 2=recommend; 3 = under] / validresponse = (lbuttondown) / recorddata = false </trial>
<text scorereport> / items = ("~tYour accuracy in identifying alcoholic beverages was <%expressions.alc_percent%>%. ~r~r Your accuracy in identifying non-alcoholic beverages was <% expressions.nonalc_percent %>%.") / hjustify = center / vjustify = center / fontstyle = ("Arial", 3.5%) / position = (50%, 25%) / size = (100%, 30%) </text>
<text recommend> / items = ("~tEither one or both of these accuracies is UNDER our 75% requirement, which was outlined in our consent form.~n If you submit this HIT, we will reject it. We recommend you return the hit so as not to impact your rating.~n Please press Ctrl+Q to exit.~n~n Thank you for participating, and best of luck.") / hjustify = center / vjustify = center / fontstyle = ("Arial", 2.5%, true) / position = (50%, 55%) / size = (100%, 30%) </text>
<text under> / items = ("UNDER our 75% requirement,") / hjustify = center / vjustify = center / fontstyle = ("Arial", 2.5%, true) / position = (52.84%, 44.79%) / txcolor = red </text> ------------------------------------------------- CAPTURE CHECK ------------------------------------------------- <trial nocapture> / stimulusframes = [1=accreport; 2=recommend2] / validresponse = (lbuttondown) / recorddata = false </trial>
<text accreport> / items = ("~tOut of our 4 mandatory attention checks, you passed <% values.capture %>.~r~r This is under our attention check requirement, which was outlined in our consent form.") / hjustify = center / vjustify = center / fontstyle = ("Arial", 3.5%) / position = (50%, 35%) / size = (100%, 30%) </text>
<text recommend2> / items = ("~tIf you submit this HIT, we will reject it. We recommend you return the hit so as not to impact your rating.~n Please press Ctrl+Q to exit.~n~n Thank you for participating, and best of luck.") / hjustify = center / vjustify = center / fontstyle = ("Arial", 2.5%, true) / position = (50%, 65%) / size = (100%, 30%) </text>
------------------------------------------------- END ------------------------------------------------- <trial end> / pretrialpause = 250 / posttrialpause = 250 / stimulustimes = [1=end] / validresponse = (57) / inputdevice = keyboard / recorddata = false </trial>
<text end> / items = end / hjustify = center / vjustify = center / fontstyle = ("Arial", 2.5%, true) / size = (90%, 80%) / position = (50%, 50%) / select = sequence / resetinterval = 0 </text>
<item end> /1 ="The tasks are now complete. You scored above 75% in accuracy and passed all of our attention checks.~r~r Thank you for participating in this validation survey! We will be in touch for a follow-up with bonus payment in a few weeks.~r" </item>
I'm sure it's a total mess. I also think I've yet to fully grasp values & expressions.
Thanks, as ever, for the feedback.
|
By Dave - 4/27/2016
Since you want to invoke another <block> based on performance, you need to use /branch. You cannot use /onblockend for that. I.e., it needs to read
<block slider> / trials = [ 1-38 = noreplace(capture1, capture2, alc, alc, alc, alc, alc, alc, alc, alc, alc, alc, alc, alc, alc, alc, alc, alc, alc, alc, nonalc, nonalc, nonalc, nonalc, nonalc, nonalc, nonalc, nonalc, nonalc, nonalc, nonalc, nonalc, nonalc, nonalc, nonalc, nonalc, nonalc, nonalc)] / branch = [if (values.capture < 4) block.nocapture else block.stimintro] </block>
and from <block stimintro> you'll then of course want to branch to <block stimuli>
<block stimintro> / trials = [1 = preinstructions_3; 2 = instructions_3; 3-4 = instructions_3a; 5-6 = instructions_3b; 7-10 = instructions_3c; 11 = probe_practice1; 12 = probe_practice2; 13 = instructions_4] / bgstim = (spacebar) / branch = [block.stimuli] </block>
and so forth.
Beyond that the script excerpts are far too incomplete for me to say much. Since I cannot run this thing to all the missing bits and pieces, I cannot actually test it. None of the logic that updates the values you ultimately want to base your /branches on is included, i.e., I have no way of ascertaining whether
<block stimuli> ... / branch = [if (expressions.alc_percent < 75 || expressions.nonalc_percent < 75) block.underaccuracy else block.mturk] </block>
expressions.alc_percent and expressions.nonalc_percent actually *could* reach values greater or smaller than 75.
Useful tip: During script execution, pressing CTRL+D allows you inspect the current state of any value or expression at that given moment.
|
By ldobb - 4/27/2016
Totally fair, I have attached the script to this post. I just realized that I branched to "stimuli" instead of "block.stimuli" and that sort of thing, so apologies in advance.
Also, I should give you credit for tons of stuff in this script since you've been so integral in its creation :)
|
By Dave - 4/27/2016
The attached revision (only minor changes; as detailed in the previous response) should work just fine.
|
By ldobb - 5/2/2016
Dave,
Looks fantastic! I piloted it and intentionally failed all captures and it rerouted to the "nocapture" page perfectly. However, the second portion with the accuracy check...I did it and intentionally got everything wrong, and the paradigm ended then loops back to "slider." Then, when I made <expt> only to be stimintro, and tried to go through it that way, I finished the paradigm and the task ended completely. Any thoughts as to what's going on? I'm sure it has to do with my values & expressions...
Your help is ever appreciated! Lily
|
By ldobb - 5/2/2016
Dave, I think I figured it out! I split the /ontrialend into two conditions rather than one with || Hopefully that'll do the trick.
|
By ldobb - 5/2/2016
Hi again Dave,
So, all is well with that part of the script. However, I'm now facing another problem. See the attached script (I simplified it from the previous one). The idea is that there are 18 matched pairs of pictures with an arrow probe I have tried to have it randomized such that be each image gets a chance to be on the left and on the right, and then also with the < or >, for a total of 4 trials each. So, 72 total. The problem is my randomization and repetition is clearly all wrong. When I look at the raw data, sometimes images are appearing more than 4 times, sometimes not at all...what am I doing wrong?
At my lab we've been joking that we should give you a shoutout in the paper :)
|
By Dave - 5/2/2016
You have
<picture alc_pics> / items = ("1P_1.jpg","1P_2.jpg","1P_3.jpg","1P_4.jpg","1P_5.jpg", "1P_6.jpg","1P_7.jpg","1P_8.jpg","1P_9.jpg","1P_10.jpg", "1P_11.jpg", "1P_12.jpg", "1P_13.jpg", "1P_14.jpg", "1P_15.jpg", "1P_16.jpg", "1P_17.jpg", "1P_18.jpg") / select = noreplace / size = (85%, 85%) / vposition = 50% / hposition = counter.type1pos.selectedvalue </picture>
<picture nonalc_pics> / items = ("2P_1.jpg","2P_2.jpg","2P_3.jpg","2P_4.jpg","2P_5.jpg", "2P_6.jpg","2P_7.jpg","2P_8.jpg","2P_9.jpg","2P_10.jpg", "2P_11.jpg", "2P_12.jpg", "2P_13.jpg", "2P_14.jpg", "2P_15.jpg", "2P_16.jpg", "2P_17.jpg", "2P_18.jpg") / select = picture.alc_pics.currentindex / size = (85%, 85%) / vposition = 50% / hposition = counter.type2pos.selectedvalue </picture>
which defines the 18 pairs. 1P_1 & 2P_1 form the 1st pair, 1P_2 & 2P_2 form the 2nd pair, and so forth.
Think of the above as a deck of 18 cards, with the different pairs written on the cards. You draw from that deck of cards *without replacement* (noreplace).
You have two <trial> elements -- <trial arrowL> and <trial arrowR> -- that draw from that deck of 18 cards:
<trial arrowL> ... / stimulustimes = [0 = fixation; 500 = erasefixation, alc_pics, nonalc_pics, arrowL; 700 = blankscreen, drink_nonalc, drink_alc] ... </trial>
<trial arrowR> ... / stimulustimes = [0 = fixation; 500 = erasefixation, alc_pics, nonalc_pics, arrowR; 700 = blankscreen, drink_nonalc, drink_alc] ... </trial>
Think about arrowL as your left hand and arrowR as your right hand.
You then proceed to draw 36 times with your LEFT hand and 36 times with your RIGHT hand from the deck:
<block stimuli> / trials = [1-72 = noreplace( arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR)] </block>
There is no reason why across all those draws you should end up with having drawn the SAME set of cards with both your left and right hand.
Furthermore, for the random on-screen position, you make no adjustments at all. You simply draw from two x/y positions randomly *without* replacement.
<counter type1pos> / items = (20%,80%) / select = noreplace </counter>
<counter type2pos> / items = (20%,80%) / not = (type1pos) / select = noreplace / selectionrate = trial </counter>
Here, too, there is no reason that ALC should appear equally often on the LEFT in arrowL trials as it does in arrowR trials.
I've explained the same thing previously in some more detail here: https://www.millisecond.com/forums/Topic14239.aspx
In short: You need to set up *separate* <picture> etc. elements for <trial arrowL> and <trial arrowR>, i.e., have (at least) *two* separate decks of 18 cards to draw from: One you draw from with your LEFT hand, another one you draw from with your RIGHT hand.
I hope the deck of cards analogy makes things a little clearer / more tangible as opposed to talking about selection in the abstract. (I often think about sampling problems in those terms and have found it useful to do so.)
|
By ldobb - 5/3/2016
So, I did this again with two sets of pictures (alc_picsL) and (alc_picsR) plus their nonalc counterparts. Still, when I look at the raw data, I'm not getting the equal spread that I want. I definitely understand your analogy with the hands of cards/decks, I just think I'm not understanding the full implementation. I uploaded the script again for reference.
|
By Dave - 5/3/2016
<block stimuli> / trials = [1-72 = noreplace( arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL, arrowL,
arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR, arrowR
)] </block>
Only glancing over the script, the above seems misspecified. There are *32* arrowL trials and *32* arrowR trials listed (64 total). You want to run 72 trials total, with -- as far as I understand -- 36 arrowL and 36 arrowR.
|
By ldobb - 5/3/2016
Nice catch, whoops. Still, when I run a tes.t, it doesn't show everything evenly. Attached is the raw data
|
By ldobb - 5/3/2016
Are all of my selectionmodes correct? I probably have them wrong. Argh.
|
By Dave - 5/3/2016
<trial arrowL> / ontrialbegin = [values.probe_alc_pos = picture.alc_picsL.hposition; values.probe_nonalc_pos = picture.nonalc_picsL.hposition; values.probe_arrow_pos = "L"] / ontrialbegin = [if (picture.alc_picsL.hposition == 20%) values.image_name = picture.alc_picsL.currentitem] / ontrialbegin = [if (picture.alc_picsL.hposition == 20%) values.image_cat = "ALC"] / ontrialbegin = [if (picture.nonalc_picsL.hposition == 20%) values.image_name = picture.nonalc_picsL.currentitem] / ontrialbegin = [if (picture.nonalc_picsL.hposition == 20%) values.image_cat = "NONALC"] / stimulustimes = [0 = fixation; 500 = erasefixation, alc_picsL, nonalc_picsL, arrowL; 700 = blankscreen, drink_nonalc, drink_alc] / validresponse = (200, 208) / iscorrectresponse = [(picture.alc_picsL.hposition == 20% && text.drink_alc.vposition == 35% && trial.arrowL.response == 200) || (picture.alc_picsL.hposition == 20% && text.drink_alc.vposition == 65% && trial.arrowL.response == 208)] / iscorrectresponse = [(picture.nonalc_picsL.hposition == 20% && text.drink_alc.vposition == 35% && trial.arrowL.response == 200) || (picture.nonalc_picsL.hposition == 20% && text.drink_alc.vposition == 65% && trial.arrowL.response == 208)] / correctmessage = (drink_alc_clicked, 500) / errormessage = (drink_nonalc_clicked, 500) / branch = [if (picture.alc_picsL.hposition == 20% && text.drink_nonalc.vposition == 35% && trial.arrowL.response == 200) trial.arrowL.error == true] / branch = [if (picture.nonalc_picsL.hposition == 20% && text.drink_nonalc.vposition == 65% && trial.arrowL.response == 208) trial.arrowL.error == true] / responsemessage = (0, blankscreen, 100) / timeout = 3700 / posttrialpause = 1000 </trial>
No. One of the problems (I'm not sure how many there are, because I'm not 100% clear on what "spread" exactly you expect or intend to achieve), is that the values where you record image name, etc., and which -- I think -- you rely on when "checking" the "spread", do *not* reflect what you think they reflect.
/ontrialbegin attributes are executed *before* any stimuli are selected, which only happens when /stimulustimes is prepared and executed. I.e.
/ ontrialbegin = [if (picture.alc_picsL.hposition == 20%) values.image_name = picture.alc_picsL.currentitem]
will *not* reflect the item that *will eventually be* selected in that <trial>'s given instance. It reflects the item *currently* selected for that <picture> element, which -- since selection in the current trial's instance hasn't happened yet -- reflects what *was* selected in the *previous* instance of the trial.
The same goes for the position stuff and the logic you base on that.
What you'll want to do to fix that is something along the lines of
<trial arrowL> / ontrialbegin = [picture.alc_picsL.hposition = counter.type1pos.selectedvalue; picture.nonalc_picsL.hposition = counter.type2pos.selectedvalue; ] / ontrialbegin = [values.probe_alc_pos = picture.alc_picsL.hposition; values.probe_nonalc_pos = picture.nonalc_picsL.hposition; values.probe_arrow_pos = "L"] / ontrialend = [if (picture.alc_picsL.hposition == 20%) values.image_name = picture.alc_picsL.currentitem] / ontrialend = [if (picture.alc_picsL.hposition == 20%) values.image_cat = "ALC"] / ontrialend = [if (picture.nonalc_picsL.hposition == 20%) values.image_name = picture.nonalc_picsL.currentitem] / ontrialend = [if (picture.nonalc_picsL.hposition == 20%) values.image_cat = "NONALC"] / stimulustimes = [0 = fixation; 500 = erasefixation, alc_picsL, nonalc_picsL, arrowL; 700 = blankscreen, drink_nonalc, drink_alc] / validresponse = (200, 208) / iscorrectresponse = [(picture.alc_picsL.hposition == 20% && text.drink_alc.vposition == 35% && trial.arrowL.response == 200) || (picture.alc_picsL.hposition == 20% && text.drink_alc.vposition == 65% && trial.arrowL.response == 208)] / iscorrectresponse = [(picture.nonalc_picsL.hposition == 20% && text.drink_alc.vposition == 35% && trial.arrowL.response == 200) || (picture.nonalc_picsL.hposition == 20% && text.drink_alc.vposition == 65% && trial.arrowL.response == 208)] / correctmessage = (drink_alc_clicked, 500) / errormessage = (drink_nonalc_clicked, 500) / branch = [if (picture.alc_picsL.hposition == 20% && text.drink_nonalc.vposition == 35% && trial.arrowL.response == 200) trial.arrowL.error == true] / branch = [if (picture.nonalc_picsL.hposition == 20% && text.drink_nonalc.vposition == 65% && trial.arrowL.response == 208) trial.arrowL.error == true] / responsemessage = (0, blankscreen, 100) / timeout = 3700 / posttrialpause = 1000 </trial>
|
By Dave - 5/3/2016
P.S.: For a simple illustration that may clarify the above, see the example at https://www.millisecond.com/forums/FindPost16492.aspx .
|
By ldobb - 5/3/2016
That's super helpful, thanks so much for that. I'm now thinking the error must be somewhere in the selection or counter or my understanding thereof. I set the block to this: <block stimuli> / trials = [1-36 = noreplace(arrowL) </block>
Then I ran the monkey through it, then looked at the data, expecting that each of the 36 images should appear once. This wasn't the case, as soon pictures appeared 2-3x and some not at all. To be clear, I have 18 image pairs. I want each image to appear twice on the left, and twice on the right, with the arrow probe point L&R for each orientation. So ideally something like: ALC < NONALC ALC > NONALC NONALC < ALC NONALC > ALC For every single pair. It should be 72 trials, then. But I'm doing something totally wrong. When you look at the script, is it coded with that arrangement in mind? Or have I not set it up properly?
|
By Dave - 5/3/2016
I've tried to explain this before in this thread. To quote the relevant portion:
"Furthermore, for the random on-screen position, you make no adjustments at all. You simply draw from two x/y positions randomly *without* replacement.
<counter type1pos> / items = (20%,80%) / select = noreplace </counter>
<counter type2pos> / items = (20%,80%) / not = (type1pos) / select = noreplace / selectionrate = trial </counter>
Here, too, there is no reason that ALC should appear equally often on the LEFT in arrowL trials as it does in arrowR trials."
You do *not* have any provisions at all as to where a specific image item should appear across X number of trials. You sample from *two* positions randomly *without* replacement. The positions are neither tied to any particular item nor a particular class of item (ALC or NONALC)
Suppose in the first trial 80% is selected in type1pos (and conversely 20% in type2pos). Then in the *next* trial -- since you are sampling without replacement -- 20% will be selected in type1pos and 80% necessarily.
The deck of cards analogy applies here as well, and it also applies to other selection modes (with replacement, etc.).
Hope this clarifies.
|
By ldobb - 5/3/2016
I see what you mean. Should I tie them to items? Get rid of the "noreplace"? Thank you for being patient with me, it's my first coding language ever.
|
By ldobb - 5/3/2016
I see what you mean. Should I tie them to items? Get rid of the "noreplace"? Thank you for being patient with me, it's my first coding language ever.
|
By ldobb - 5/3/2016
I even tried to forgo the random counters altogether and just used4 separate picture "decks..." Again, I must be doing something wrong...
|
By Dave - 5/3/2016
> forgo the random counters altogether and just used4 separate picture "decks..."
This is one workable approach.
Problem:
<trial L_A1> / ontrialbegin = [values.probe_alc_pos = "L"; values.probe_nonalc_pos = "R"; values.probe_arrow_pos = "L"; values.image_name = picture.alc_picsL1.currentitem; values.image_cat = "ALC"] ... </trial>
As explained previously, currentitem will not reflect what you want when read /ontrialbegin. This belongs in /ontrialend to have the expected result, i.e., reflect *what was displayed in that instance of the trial*.
Once you fix that, everything should be fine.
|
By ldobb - 5/4/2016
That was it! Dave, you're the best.
|
|