Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
Define a /responsemessage for "no response" that shows a blank stimulus:
<block alcohol> / trials = [1-10 = alcohol] </block>
<picture alcohol> / items = ("1L_1.jpg","1L_2.jpg","1L_3.jpg","1L_4.jpg","1L_5.jpg","1L_6.jpg","1L_7.jpg","1L_8.jpg","1L_9.jpg","1L_10.jpg") / select = replacenorepeat / size = (80%, 80%) </picture>
<trial alcohol> / stimulusframes = [1=alcohol, alc_categories1, alc_categories2] / validresponse = (32, 37) / iscorrectresponse = [(text.alc_categories2.hposition==20% && trial.alcohol.response==32) || (text.alc_categories2.hposition==80% && trial.alcohol.response==37)] / errormessage = (alc_categories1_clicked, 500) / correctmessage = (alc_categories2_clicked, 500) / responsemessage = (0, blankscreen, 500) / timeout = 5000 </trial>
<shape blankscreen> / shape = rectangle / color = white / size = (100%, 100%) </shape>
<text alc_categories1> / items = ("Non-alcoholic beverage","Food","Non-food object") / select = replace / vposition = 50% / hposition = counter.type1pos.selectedvalue / txcolor = black </text>
<text alc_categories2> / items = ("Alcoholic beverage") / vposition = 50% / hposition = counter.type2pos.selectedvalue / txcolor = black </text>
<text alc_categories1_clicked> / items = ("Non-alcoholic beverage","Food","Non-food object") / select = text.alc_categories1.currentindex / vposition = 50% / hposition = text.alc_categories1.hposition / txcolor = red </text>
<text alc_categories2_clicked> / items = ("Alcoholic beverage") / vposition = 50% / hposition = text.alc_categories2.hposition / txcolor = red </text>
<counter type1pos> / items = (20%,80%) / select = noreplace </counter>
<counter type2pos> / items = (20%,80%) / not = (type1pos) / select = noreplace </counter>
|
|
|
ldobb
|
|
Group: Forum Members
Posts: 36,
Visits: 146
|
Hi Dave,
Last question I hope! The script works perfectly. The only thing I noticed is that the errormessage (text turns a different color) will also logically appear if the participant gives no response at all. Is there a way for me to make it so that if no response is given, the trial just moves forward to the next in the block without showing the errormessage?
|
|
|
ldobb
|
|
Group: Forum Members
Posts: 36,
Visits: 146
|
You beat me to it, I'll take a look at all of that. Thanks, Dave :)
|
|
|
ldobb
|
|
Group: Forum Members
Posts: 36,
Visits: 146
|
Are there any other posts/documents I can look to for understanding how to best set up this logic? Would it be something like: / iscorrectresponse = [if (text.alc_alc.hposition == 20%) trial.alcohol.correct == "Z"; if (text.alc_alc.hposition == 80%) trial.alcohol.correct == "/"] ???
And then in the data file, is there a way for me to record what the key corresponded to? Or should I just have all the stimulusitem columns and then a correct column and figure it out myself?
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
In short, you do (example uses the D and K keys on the keyboard)
<block alcohol> / trials = [1-10 = alcohol] </block>
<picture alcohol> / items = ("1L_1.jpg","1L_2.jpg","1L_3.jpg","1L_4.jpg","1L_5.jpg","1L_6.jpg","1L_7.jpg","1L_8.jpg","1L_9.jpg","1L_10.jpg") / select = replacenorepeat / size = (80%, 80%) </picture>
<trial alcohol> / stimulusframes = [1=alcohol, alc_categories1, alc_categories2] / validresponse = (32, 37) / iscorrectresponse = [(text.alc_categories2.hposition==20% && trial.alcohol.response==32) || (text.alc_categories2.hposition==80% && trial.alcohol.response==37)] / errormessage = (alc_categories1_clicked, 500) / correctmessage = (alc_categories2_clicked, 500) </trial>
<text alc_categories1> / items = ("Non-alcoholic beverage","Food","Non-food object") / select = replace / vposition = 50% / hposition = counter.type1pos.selectedvalue / txcolor = black </text>
<text alc_categories2> / items = ("Alcoholic beverage") / vposition = 50% / hposition = counter.type2pos.selectedvalue / txcolor = black </text>
<text alc_categories1_clicked> / items = ("Non-alcoholic beverage","Food","Non-food object") / select = text.alc_categories1.currentindex / vposition = 50% / hposition = text.alc_categories1.hposition / txcolor = red </text>
<text alc_categories2_clicked> / items = ("Alcoholic beverage") / vposition = 50% / hposition = text.alc_categories2.hposition / txcolor = red </text>
<counter type1pos> / items = (20%,80%) / select = noreplace </counter>
<counter type2pos> / items = (20%,80%) / not = (type1pos) / select = noreplace </counter>
or something similar. You can find lots of examples using /isvalid- and /iscorrectresponse on the forum or in the scripts available in the library if you want to delve in deeper.
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
Correct. You need to apply conditional logic via the <trial>'s /iscorrectresponse attribute. You'll then also want to use /correctmessage and /errormessage instead of /responsemessage.
|
|
|
ldobb
|
|
Group: Forum Members
Posts: 36,
Visits: 146
|
I should also add that if I just have the characters as responses, it'll be somewhat hard for me to understand the data at the end. Hopefully there's a way around that too.
|
|
|
ldobb
|
|
Group: Forum Members
Posts: 36,
Visits: 146
|
Hi again, Dave -
I have a new question involving the same task as troubleshot above.
Basically, I'd like to maintain the paradigm but instead of clicking, I'd like to assign the Z and / keys on the keyboard to mean left and right, respectively.
My issue is that because the hpositions are randomized, I don't know how to properly assign the "correctresponse" characters, or the "responsemessage" characters. I imagine I need some sort of conditional logic, or I need some way to associate a key with an hposition? I'm really not sure. The script is exactly the same as above because I haven't touched it/am not sure where to begin.
Thanks in advance.
|
|
|
ldobb
|
|
Group: Forum Members
Posts: 36,
Visits: 146
|
Amazing, thanks as always. Works like a charm now.
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
Change that counter's selectionrate to trial
<counter type2pos> / items = (20%,80%) / not = (type1pos) / select = noreplace
/ selectionrate = always / selectionrate = trial </counter>
There's no reason to have it set to always.
|
|
|