count mouse clicking


Author
Message
luhe
luhe
Associate Member (229 reputation)Associate Member (229 reputation)Associate Member (229 reputation)Associate Member (229 reputation)Associate Member (229 reputation)Associate Member (229 reputation)Associate Member (229 reputation)Associate Member (229 reputation)Associate Member (229 reputation)
Group: Forum Members
Posts: 2, Visits: 2
Dear 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

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
luhe - Wednesday, October 24, 2018
Dear 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>



luhe
luhe
Associate Member (229 reputation)Associate Member (229 reputation)Associate Member (229 reputation)Associate Member (229 reputation)Associate Member (229 reputation)Associate Member (229 reputation)Associate Member (229 reputation)Associate Member (229 reputation)Associate Member (229 reputation)
Group: Forum Members
Posts: 2, Visits: 2
Dave - Wednesday, October 24, 2018
luhe - Wednesday, October 24, 2018
Dear 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>



Hi Dave,

Thank you very much for your quick response!

Cheers,
Lutz

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search