By Lucie1043 - 12/14/2015
Hi Supreme being,
I already asked you a question last week and you've been very helpful! So, here's another one:
Two cues (stimulus A and stimulus B) appear simultaneously on the screen, so that participants have to select by mouse-clicking one of those two cues. Clicking on cue A gives access to a trial of task A, whereas clicking on cue B gives access to a trial of task B. However, the number of clicks on cue A required to get access to a trial of task A increases every ten trials (during the first ten trials, the participant has to click only once on cue A in order to get access to the trial of task A, but during the next ten trials, he has to click twice, then 4 times, 8 times, 16 times, 32 times...).
I would really appreciate your ideas on the best way to program this task.
Thanks, Lucie
-
|
By Dave - 12/14/2015
You can do something like this:
<values> / aclickcount = 0 / arequiredcount = 1 </values>
<expt> / blocks = [1-4=choiceblock] </expt>
<block choiceblock> / onblockbegin = [if (block.choiceblock.totalcount > 0) values.arequiredcount = 2 * values.arequiredcount; ] / trials = [1-10=choice] </block>
<trial choice> / ontrialend = [if (trial.choice.response=="astim") values.aclickcount+=1; ] / stimulusframes = [1=astim, bstim, debug] / validresponse = (astim, bstim) / inputdevice = mouse / branch = [if (trial.choice.response=="bstim") trial.b] / branch = [if (trial.choice.response=="astim" && values.aclickcount>=values.arequiredcount) trial.a else trial.choice] </trial>
<trial a> / ontrialend = [values.aclickcount=0] / stimulusframes = [1=mytext, debug] / validresponse = (57) </trial>
<trial b> / ontrialend = [values.aclickcount=0] / stimulusframes = [1=mytext, debug] / validresponse = (57) </trial>
<text astim> / items = ("A") / position = (40%, 50%) </text>
<text bstim> / items = ("B") / position = (60%, 50%) </text>
<text mytext> / items = ("<%script.currenttrial%>") </text>
<text debug> / items = ("A clicks required: <%values.arequiredcount%> | A clicks made: <%values.aclickcount%>") / position = (50%, 10%) / erase = false </text>
|
By Lucie1043 - 12/14/2015
thanks a lot! It is working perfectly!
|
By Lucie1043 - 12/15/2015
I want to randomize the position of cue A and B in the script you wrote.
In order to do so, I created the following script:
<picture indiceA> /items = indiceA /vposition = 50 /hposition = list.indicehposition.nextvalue </picture>
<picture indiceB> /items = indiceB /vposition = 50 /hposition = list.indicehposition.nextvalue </picture>
<list indicehposition> / items = (30%, 70%) / selectionrate = always </list>
However, I need the position of the cue to stay the same during a <trial choice> and to be random across trials.
How shall I procede?
Thanks again!
|
By Dave - 12/15/2015
You store the hposition for A and B in global variables (<values> entries) and only update those variables when the clickcount is 0, i.e. at the start of a "round":
<values> / aclickcount = 0 / arequiredcount = 1 / ahpos = 0% / bhpos = 0% </values>
<expt> / blocks = [1-4=choiceblock] </expt>
<block choiceblock> / onblockbegin = [if (block.choiceblock.totalcount > 0) values.arequiredcount = 2 * values.arequiredcount; ] / trials = [1-10=choice] </block>
<trial choice> / ontrialbegin = [if (values.aclickcount <= 0) {values.ahpos=list.indicehposition.nextvalue; values.bhpos=list.indicehposition.nextvalue; }; ] / ontrialend = [if (trial.choice.response=="astim") values.aclickcount+=1; ] / stimulusframes = [1=astim, bstim, debug] / validresponse = (astim, bstim) / inputdevice = mouse / branch = [if (trial.choice.response=="bstim") trial.b] / branch = [if (trial.choice.response=="astim" && values.aclickcount>=values.arequiredcount) trial.a else trial.choice] </trial>
<list indicehposition> / items = (30%, 70%) / selectionrate = always </list>
<trial a> / ontrialend = [values.aclickcount=0] / stimulusframes = [1=mytext, debug] / validresponse = (57) </trial>
<trial b> / ontrialend = [values.aclickcount=0] / stimulusframes = [1=mytext, debug] / validresponse = (57) </trial>
<text astim> / items = ("A") / vposition = 50% / hposition = values.ahpos </text>
<text bstim> / items = ("B") / vposition = 50% / hposition = values.bhpos </text>
<text mytext> / items = ("<%script.currenttrial%>") </text>
<text debug> / items = ("A clicks required: <%values.arequiredcount%> | A clicks made: <%values.aclickcount%>") / position = (50%, 10%) / erase = false </text>
|
|