Count and display valid responses in data file


Author
Message
helenr
helenr
Esteemed Member (1.6K reputation)Esteemed Member (1.6K reputation)Esteemed Member (1.6K reputation)Esteemed Member (1.6K reputation)Esteemed Member (1.6K reputation)Esteemed Member (1.6K reputation)Esteemed Member (1.6K reputation)Esteemed Member (1.6K reputation)Esteemed Member (1.6K 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 (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: 12K, Visits: 98K
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
Esteemed Member (1.6K reputation)Esteemed Member (1.6K reputation)Esteemed Member (1.6K reputation)Esteemed Member (1.6K reputation)Esteemed Member (1.6K reputation)Esteemed Member (1.6K reputation)Esteemed Member (1.6K reputation)Esteemed Member (1.6K reputation)Esteemed Member (1.6K 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 (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: 12K, Visits: 98K
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

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search