Changing the duration of a sketchpad depending on the response time
Hello,
I have some issue to access the response time value for compute the duration of a sketchpad.
In my experiment there is a Keyboard_response (called "risposta") with a duration of 10.000 (10s).
After that I have a sketchpad (ISI) and I want to show it for a duration of 10.000 - response_time_risposta.
I added a inline script ISI_duration in wich I creata a variable to compute the duration in this way
var.ISIdur= 10000-response_time_risposta
But OpenSesame says: NameError: name 'response_time_risposta' is not defined
I cannot find a way to access the variable "response_time_risposta", I saw it in the variable inspector tool.
What is the correct way to do it?
Thanks a lot,
Paolo
Here is my experiment's structure

Comments
Hi Paolo,
Sketchpads are drawn in the prepare phase, that is everything that is included in making them, needs to available at the prepare phase. To use information that are only computed in a trial itself (like RT), you should usefeedbackitems (see here).Hope this helps.
Eduard
I change the inline script accordingly to "the prepare-run strategy" and now is working.
Thanks a lot for your help!
Paolo
Alternatively, you should be able to use a sketchpad. Set duration to zero and put your Inline script after it.
Something along these lines should work. But if there is a good reason to use feedback items instead, I'd like to hear it. Precision timing perhaps?
Not particular reasons. If anything, then using a
feedbackitem will be slower, as it is executed in the run-phase. So if you need precise timing and have heavy displays,feedbackitems shouldn't be used (or the timing should be tested, at least).In general, I prefer having fewer items in my
sequence, so if I can do something with only afeedbackitem instead of asketchpadand aninline_script, I'd got for thefeedbackitem. Well, actually, I would only use aninline_scriptand do the stimulus presentation entirely in it.Eduard
The timing is not so important in this case.
I cannot figure it out how to use only the "feedback" item without the inline code.
I choose a different solution:
-An "Inline code" to compute the duration after "risposta" and before "ISI"
set description "Executes Python code" set _run "var.ISIdur= 10000-var.response_time_risposta" ___prepare__ var.ISIdur=0 __end__-"Sketchpad ISI" with duration "[ISIdur]"
Thanks
Paolo