#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

# Duration time presentation stimuli

edited January 2016

Hello !
I have prepare a Stroop modified task. I wish to reccord reaction time of participants. When the stimulus appears on the screen, participant have to choose between 4 keys on the keypad. Open Sesame reccords correct responses and reaction time.

My problem is that in the keyboard-response, the duration is "keypress". That means the stimulus disappear after the participant gives is answer. So, the presentation time of each stimuli change according the reaction time.

What I want is to have the same presentation time for each stimuli (1000ms).

Here is my code :

set duration 0
set description "Displays stimuli"
draw textline center=1 color="[Color_word]" font_bold=yes font_family=mono font_italic=no font_size=32 html=yes show_if=always text="[Word]" x=0 y=0 z_index=0


Keyboard_response :

set timeout 3000
set flush "yes"
set duration "keypress"
set description "Collects keyboard responses"
set correct_response "[Correct_response]"
set allowed_responses "q;s;l;m"


I tried to set duration in keyboard response as "1000" ms but it crashes (the task doesn't run).

Can somebody help me with this error ?

Thank you very much !

Céline

• edited 11:56AM

Hi Céline,

This sounds like a situation for the coroutines plug-in, which is described here (and needs to be installed separately):

Essentially, you want to do two things simultaneously:

1. Collect a keyboard response with a timeout of 3000 ms; and
2. Show a target sketchpad, followed by a blank sketchpad 1000 ms later.

In the coroutines plug-in, this would look as follows:

Does that make sense?

Cheers,
Sebastiaan

• edited January 2018

instead of a "sequence" I added a "coroutine" but now I always get an error message!

File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item.py", line 235, in getattr

I really don't get the problem. What did I do wrong?

• @vvogel Until recently there was a bug with feedback items within a coroutines. So that's what you're running into. I would either:

• Use sketchpad items instead of feedback items; or
• Grab the latest (soon-to-be released) OpenSesame 3.2 prerelease from http://osdoc.cogsci.nl/3.2

Cheers!
Sebastiaan

• Hi Sebastiaan,

I have a problem related to the topic here. I also want to present visual stimuli for a certain time and at the same time capture the reaction time measured by a keypress. I already tried to use Corountines, but in the files only the duration of the keypress itself appears, I guess, because it is always around 0.5-0.7 ms. So how is it possible to capture the time between the start of the stimulus presentation and the following keypress?

Thank you!

Anna

• The response_time always reflects the interval between the start of the keyboard_response and the moment that a key was actually pressed. If you're using a coroutines item, this means that the start time of the keyboard_response (in the coroutines ) should coincide with the start time of the sketchpad (in the coroutines ) that contains the stimulus. Does that clear things up?

— Sebastiaan

• Hi Sebastiaan,

thank you for your answer. So, the response time reflects the interval between the start time of the visual stimuli and the actual keypress and so, if i pressed the key always after approximately 5 seconds the response_time should display something around 5000ms, but in the excel file the response_time_keyboard_response displays values around 0.5(ms) and I don't understand why that is. Could you comment on that again?

Thanks again,

Anna

• Without knowing the details of how you implemented the experiment, this is impossible to say. Could you attach the experiment file here?

— Sebastiaan

• Hi Sebastiaan,

of course. Attached you should find the Example experiment file.

Anna

• Hi Sebastiaan,

sorry, apparently it didn't work to attach the open sesame file. Attached you can find now some screenshots, which should demonstrate the implemented experiment.

• @Anna_Schellhorn The start and the end time of the keyboard_response are both set to 0. So this means that key presses are only polled once, at the very start of the coroutines . If you to poll continuously, then you have to set the end time to 9995 (in your case, i.e. the duration of the coroutines ). Does that clear things up?