Does text_input form have correct or response time variable?
in OpenSesame
Hello,
I am designing a math study that asks children to enter the answer to an equation and press 'enter' to move on to the next question using the text_input form. However, I was wondering if 'form_text_input' have a 'correct' or 'response time' variable? If not, is it possible/is there a way to log them?
Thanks in advance!
Comments
Hi @choql,
As far as I can tell, form inputs don't have a
correctvariable (as they do not seem to allow a variable to be defined as the correct response) or a response time variable. These variables do appear in the log but they'll contain the data relative to whatever keyboard or mouse response was last taken (e.g., pressing the space bar to get passed the welcome sketchpad).So, you'd have to define these variables through coding.
Here's a simple example where some basic math problems are presented on a form and subjects type in their responses:
I defined the correct response in the loop:
In order to score the subject's response and measure the RT, we can use some code right after the form input object(so that we waste no time measuring the RT). Here I do it in Javascript (in case you're interested in running your experiment online) - if you're gonna execute it on a device running OS, you could also use Python coding.
Here's the Javascript code:
// computes response time vars.response_time = vars.time_score_response - vars.time_math_problem // computes score if (vars.form_response==vars.correct_response) { vars.correct = 1 } else { vars.correct = 0 }To make things simple, I store the RT and the score in the
vars.response_timeandvars.correctvariables respectively, but you could of course name these variables as you wish.As you can see, in order to calculate the RT, I subtract the onset time of the math problem's presentation from the onset time of the Javascript object presented right after.
I attach my example here so that you can try it out:
Note that if you're gonna run your experiment online, you will need to disable the "Log all variables" property of the logger and introduce the variables you want to see in the data log manually. In that case, make sure you include a the key variables you need.
Finally, note that while handy to have the score and RT outputted as such in the data log, you could also in fact calculate these offline in Excel (as long as your log contains the correct response and the subject's response, as well as the onset time of the math problem's presentation and the onset time of the object presented right after it).
Hope this helps!
Fabrice