|
Post by jarrod155 on Nov 23, 2022 13:42:22 GMT
I have made a simple experiment which presents a word stimulus and collects key response, my question is how i get the total correct to show on the screen at the end of the trials. I have tried to set a variable that increases count every correct response and then display this on the screen at the end - but this wasnt sucessful and I think i have the syntax incorrect.
Please can anyone help
Thanks
|
|
|
Post by alexandra (AEC) on Nov 24, 2022 14:52:19 GMT
Hi there,
would you mind sharing the part of your code in which you tried to save and then later display the result? Have you used a global variable (the one starting with a &)?
|
|
greg
New Member
Posts: 3
|
Post by greg on Jan 3, 2024 13:29:30 GMT
I have made a simple experiment which presents a word stimulus and collects key response, my question is how i get the total correct to show on the screen at the end of the trials. I have tried to set a variable that increases count every correct response and then display this on the screen at the end - but this wasnt sucessful and I think i have the syntax incorrect.
Please can anyone help
Thanks
You can do it with a variable and a counter. I myself count the trials done correctly in my experiment and it looks like this: In a block section: block main set &mycounter 0
message instone message insttwo message instthree tasklist koperta 5 end In a task you add this line: set &mycounter increaseI then prevent starting a new attempt until the previous one is done correctly by while. Set local var for 0 and make while loop like this: while $mytrial == 0 and change it only in CORRECT condition: if STATUS == CORRECT set $mytrial 1 Of course, if you want the next attempt to start regardless of correctness, skip the loops with while and just add set &mycounter increase in the task section. At the end of task: save &mycounter
|
|