Count and display valid responses in data file


Count and display valid responses in data file

Author
Message
helenr
helenr
Partner Member
Partner Member (680 reputation)Partner Member (680 reputation)Partner Member (680 reputation)Partner Member (680 reputation)Partner Member (680 reputation)Partner Member (680 reputation)Partner Member (680 reputation)Partner Member (680 reputation)Partner Member (680 reputation)

Group: Awaiting Activation
Posts: 11, Visits: 54
Hi, I was wondering whether someone could help me. I'm running a very simple task in which participants tap the space bar as many times as they can within 2 minutes (this is done twice - once in a 'chocolate trial' and once in a 'grape trial'.
In the data file, I want it to give me a total number of times each participant tapped the space bar within that 2 minute period.
Please could you let me know how I can display this information in the data file ?
Thanks in advance for your help.
Here's my (abbreviated) code:

<values >
/blocklength = 120000
/tapcount_choc = 0
/tapcount_grapes = 0
/start120speriod = 0
/food = 0
</values>
*******************************DATA FILE**********************************
<data >
/file = "Tapping task.dat"
/ columns = [date, time, subject, values.tapcount_choc, values.tapcount_grapes]
/ separatefiles = false
/ format = tab
</data>
****************************************TRIALS*******************************************************8
<trial choc>
/ inputdevice = keyboard
/ validresponse = (57)
/ timeout = 120000
/ ontrialbegin = [values.trialstarttime = script.elapsedtime]
/ ontrialend = [if (trial.choc.response == 57) values.tapcount_choc=1 else values.tapcount_choc=0; values.sumtapcount_choc=values.sumtapcount_choc+values.tapcount_choc  ]
/ branch = [trial.choc]
/ recorddata = true
</trial>
<trial grapes>
/ inputdevice = keyboard
/ validresponse = (57)
/ timeout = 120000
/ ontrialbegin = [values.trialstarttime = script.elapsedtime]
/ ontrialend = [if (trial.grapes.response == 57) values.tapcount_grapes=1 else values.tapcount_grapes=0; values.sumtapcount_grapes=values.sumtapcount_grapes+values.tapcount_grapes ]
/ branch = [trial.grapes]
/ recorddata = true
</trial>
**************************************BLOCKS**************************************
<block tapping_choc>
/ bgstim = (remindertext_choc)
/ onblockbegin = [ values.start120speriod = 0; values.tapcount_choc = 0]
/ trials = [1 = choc]
/ onblockend = [values.tapcount_choc]
/timeout = 120000
</block>
<block tapping_grapes>
/ bgstim = (remindertext_grapes)
/ onblockbegin = [ values.start120speriod = 0; values.tapcount_grapes = 0]
/ trials = [1 = grapes]
/ onblockend = [values.tapcount_grapes]
/timeout = 120000
</block>

***************************EXPERIMENT***************************************

<expt >

/ preinstructions = (intro)

/ blocks = [1 = chocolate;  2=tapping_choc;

3 = grapes; 4=tapping_grapes]

</expt>


Dave
Dave
Supreme Being
Supreme Being (415K reputation)Supreme Being (415K reputation)Supreme Being (415K reputation)Supreme Being (415K reputation)Supreme Being (415K reputation)Supreme Being (415K reputation)Supreme Being (415K reputation)Supreme Being (415K reputation)Supreme Being (415K reputation)

Group: Administrators
Posts: 8.9K, Visits: 37K
Simply log values.sumtapcount_choc & values.sumtapcount_grapes to the data file?

<data >
/file = "Tapping task.dat"
/ columns = [date, time, subject, values.tapcount_choc, values.tapcount_grapes, values.sumtapcount_choc, values.sumtapcount_grapes]
/ separatefiles = false
/ format = tab
</data>

These values need to actually exist in your <values> element of course.

<values >
/blocklength = 120000
/tapcount_choc = 0
/tapcount_grapes = 0
/start120speriod = 0
/food = 0
/sumtapcount_choc = 0
/sumtapcount_grapes = 0
</values>
helenr
helenr
Partner Member
Partner Member (680 reputation)Partner Member (680 reputation)Partner Member (680 reputation)Partner Member (680 reputation)Partner Member (680 reputation)Partner Member (680 reputation)Partner Member (680 reputation)Partner Member (680 reputation)Partner Member (680 reputation)

Group: Awaiting Activation
Posts: 11, Visits: 54
Great, thank you so much for your help! Just another question, I was hoping to display a countdown timer while participants are doing the task (i.e. so it counts down from 2 minutes). Do you know the best way to implement this ?

Thanks!


Dave
Dave
Supreme Being
Supreme Being (415K reputation)Supreme Being (415K reputation)Supreme Being (415K reputation)Supreme Being (415K reputation)Supreme Being (415K reputation)Supreme Being (415K reputation)Supreme Being (415K reputation)Supreme Being (415K reputation)Supreme Being (415K reputation)

Group: Administrators
Posts: 8.9K, Visits: 37K
Under Inquisit 3 your only option is to create a video file that displays the countdown, set up a <video> element in your script with that file as its item, and display the <video> via the <block>'s /bgstim attribute.

GO


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....






Millisecond Forums


Search