Group: Administrators
Posts: 13K,
Visits: 104K
|
Here's a simple, self-contained example for the 2nd (more complicated) option using /isvalidresponse:
<values> / spacebarpresscount = 0 / latencies = "" </values>
<block myblock> / trials = [1-2=mytrial] </block>
<trial mytrial> / ontrialbegin = [values.spacebarpresscount=0; values.latencies=""; ] / stimulusframes = [1=mytext] / trialduration = 5000 / validresponse = (57) / isvalidresponse = [if(trial.mytrial.response==57){values.spacebarpresscount += 1; values.latencies=concat(concat(values.latencies, trial.mytrial.latency),","); false}; ] </trial>
<text mytext> / items = ("Imagine a video being played...", "Imagine another video being played") / select = sequence </text>
<data> / columns = [date time subject group blocknum blockcode trialnum trialcode response latency values.spacebarpresscount values.latencies] / separatefiles = true </data>
|