+xDear Inquisit community,
Is there a way to obtain the amount of mouse clicks that the subject has made per trial?
I'm using a reaction time task and want to give a warning in case participants click the mouse permanently to be as quick as possible once the target stimulus is presented.
Thanks in advance!
Best regards,
Lu
You can theoretically count the clicks per a bit of /isvalidresponse logic. Basically something like this:
<values>
/ pretargetclicks = 0
</values>
<block myblock>
/ trials = [1-4 = mytrial]
</block>
<trial mytrial>
/ ontrialbegin = [values.pretargetclicks=0]
/ stimulustimes = [0=fixation; 3000=target]
/ inputdevice = mouse
/ validresponse = (lbuttondown)
/ isvalidresponse = [if(trial.mytrial.response == "lbuttondown" && trial.mytrial.latency <= 3000) {values.pretargetclicks+=1; false} else true]
/ beginresponsetime = 0
/ branch = [if (values.pretargetclicks > 0) trial.warning]
</trial>
<trial warning>
/ stimulusframes = [1=warningmsg]
/ validresponse = (0)
/ trialduration = 2000
</trial>
<text fixation>
/ items = ("+")
</text>
<text target>
/ items = ("A", "B", "C", "D")
</text>
<text warningmsg>
/ items = ("You clicked <%values.pretargetclicks%> times before the target appeared. Please don't do this.")
/ txcolor = red
</text>