Problems converting BART to keyboard press


Author
Message
ekothe
ekothe
Respected Member (424 reputation)Respected Member (424 reputation)Respected Member (424 reputation)Respected Member (424 reputation)Respected Member (424 reputation)Respected Member (424 reputation)Respected Member (424 reputation)Respected Member (424 reputation)Respected Member (424 reputation)
Group: Forum Members
Posts: 3, Visits: 1

I'm trying to edit the default BART script to use keyboard responses rather than button presses. However I'm having problems with the script.



I've made changes to the choice trials but they are not performing as expected.



<trial choice>


/ ontrialbegin = [values.countchoice = values.countchoice + 1]


/ ontrialbegin = [values.pumpresult = counter.pumpresult.selectedvalue]


/ stimulustimes = [1=collectbutton, balloon, pumpbutton, totalearnings, pumpcount, potentialearnings, ballooncount]


/ inputdevice = keyboard


/ validresponse = ("1", "2")


/ ontrialend = [if (trial.choice.response == "1" && values.countchoice == 1) 


                  values.timebefore1stpump = trial.choice.latency ]


/ ontrialend = [if (trial.choice.response == "1"  && values.countchoice > 1) 


                  {values.timebtwpumps = trial.choice.latency; 


                  values.sum_timebtwpumps = values.sum_timebtwpumps + values.timebtwpumps }]


/ ontrialend = [if (trial.choice.response == "2" && values.countchoice == 1) 


                  values.timebeforecollectwithoutpump =  trial.choice.latency ]


/ ontrialend = [if (trial.choice.response == "2" && values.countchoice > 1) 


                  values.timebtwlastpumpandcollect =  trial.choice.latency ]



/ branch = [if ( trial.choice.response == "1") trial.pump]


/ branch = [if ( trial.choice.response == "2") trial.collect]



/ recorddata = true


</trial>



When I run this script a keyboard press of 1 is registered as a collect, and a keyboard press of 2 takes me straight to the final instructions "Congratulations you've made $0.0". So there is no way to pump the balloon! 



If edit the script so that...


<trial choice>


/ ontrialbegin = [values.countchoice = values.countchoice + 1]


/ ontrialbegin = [values.pumpresult = counter.pumpresult.selectedvalue]


/ stimulustimes = [1=collectbutton, balloon, pumpbutton, totalearnings, pumpcount, potentialearnings, ballooncount]


/ inputdevice = keyboard


/ validresponse = ("2", "3")


/ ontrialend = [if (trial.choice.response == "3" && values.countchoice == 1) 


                  values.timebefore1stpump = trial.choice.latency ]


/ ontrialend = [if (trial.choice.response == "3"  && values.countchoice > 1) 


                  {values.timebtwpumps = trial.choice.latency; 


                  values.sum_timebtwpumps = values.sum_timebtwpumps + values.timebtwpumps }]


/ ontrialend = [if (trial.choice.response == "2" && values.countchoice == 1) 


                  values.timebeforecollectwithoutpump =  trial.choice.latency ]


/ ontrialend = [if (trial.choice.response == "2" && values.countchoice > 1) 


                  values.timebtwlastpumpandcollect =  trial.choice.latency ]



/ branch = [if ( trial.choice.response == "3") trial.pump]


/ branch = [if ( trial.choice.response == "2") trial.collect]



/ recorddata = true


</trial>


When I run this script a keyboard press of 2 is registered as a pump, and a keyboard press of 3 takes me straight to the final instructions "Congratulations you've made $0.0". So there is no way to collect my winnings! 

If I set the valid responses to "a" and "f" (and change all of the trial.choice.response to corresponding values) then both responses take me straight to the final instructions.


Any ideas about what might be causing this and a potential fix? 


Attachments
BART_withkeyboardpress.exp (115 views, 21.00 KB)
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Reading This Topic

Explore
Messages
Mentions
Search