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>