How can I give a response-ratio in feedback ?
Hi again !
I need your assistance again. In a previous post (http://forum.cogsci.nl/index.php?p=/discussion/2563/how-to-measure-reaction-time-releasing-a-key?new=1), I requested your help to understand how measuring some time with the release of a key.
I'm blocked on a second step. I would like to keep only the valid results and give the response-ratio every 50 trials. (Participants will be instructed to distribute their answers as equitably as possible on the left and right.)
For the moment I insert this inline script between the repeat cycle and the logger :
- if not (var.response_time < 100) and not (var.response == None) :
- var.count_resp += 1
- if var.response == "p":
- var.resp_healthy += 1
- if var.response == "a":
- var.resp_injured += 1
And this feedback at the end of the trial sequence :
- Your response ratio is :
- Right : [([resp_healthy]/[count_resp])*100] %
- Left : [([resp_injured]/[count_resp])*100] %
- Remember, you have to divide your responses as equally as possible between left and right.
- Press the space bar to continue.
There is two problems. First the counter (count_resp) increase even if the conditions ((var.response_time < 100) and (var.response == None)) were not respected. Then, I don't succeed to display the percentage of the response-ratio on the feedback screen.
If you have any idea to do that, you'll really save me !
Thanks for reading,
Ronan G.
Comments
Hi Ronan,
I don't see right away what could be the issue, but you need to check whether there is an error in the code (e.g. you conditional is not defined correctly), or whether the data looks different to what you expect (e.g. the response is never "none"). If you check the logfile you should be able to get closer to the problem.
Btw, why not simpler?:
What exactly is the issue? Are you using a
sketchpad
or afeedback
item? For feedback purposes, you should use thefeedback
item (see here). Also, be aware, currently you would not obtain the correct ratios because you bump into rounding errors.Note the difference:
Good luck,
Eduard