Two word stimuli on one sketchpad with differing duration and responses
I am trying to design an experiment in which I can present two stimuli on the same page for differing periods of time and collect different keyboard responses for each stimuli simultaneously.
For example, I have a stimulus in the center of my sketchpad that is a word which I call [stimulus] and right below it, another stimulus that is a number which I call [stimulus_2]. I want the number [stimulus_2] and word [stimulus] to appear together for 500 ms, and then I want the number to disappear so that the word displays alone for another 1300 ms. In total, I need the stimuli to be presented for 1800 ms.
When the number displays, the correct recorded keyboard response should be "spacebar." For the words, the correct recorded keyboard response should be either "z" (which means "yes" they recognized this word from the study list) or "/" (which means "no" they did not recognize this word from the study list). Both even and odd numbers will be presented, but when an odd number specifically is presented on the screen below any word, I want the participant to be able to indicate that they recognized an odd number on the screen and press the spacebar, and I want this to be possible even after the number has disappeared from the screen. Additionally, participants should also be able to indicate whether they recognized the word from the study list, so for every trial they will have to press "z" or "/". This means for every stimuli that includes an odd number, within the 1800 ms participants may have to hit both a spacebar and the "z" or "/" key.
As of right now, I have a sketchpad item with the word [stimulus] and number [stimulus_2] that displays for 500 ms with a keyboard response that has "spacebar" as an allowed response. Then, I have another sketchpad item with just the word [stimulus] that displays for 1300 ms with a keyboard response that has "z;/" as an allowed response. These are basically two different screens and require separate responses, which is not what I want. It does not work for what I am trying to do because each keypress makes the screen move onto the next stimuli, and each screen only allows for one keypress at a time.
I wanted to know if it was possible for participants to press two keys within an 1800 ms timeframe, even once the odd number has disappeared from the screen? Also, how can I keep the duration fixed, so that the stimuli remain on the screen for 1800 ms every time and the keypress does not automatically move to the next stimuli? I need to record for the keypresses, but also present each screen for a specific amount of time.
To reiterate, I am trying to make it so that when an odd number appears below the word, the participant can press "z" (or "/") AND "space" in either order, all within a fixed amount of 1800 ms.
I am not sure if this would require using the inline script, but I have very little experience with coding so I didn't know how to go about using it. Please let me know if anyone can help me figure this out, or if it doesn't make sense and you need more information. I appreciate it!
Comments
HI @NikitaAdhikari@nikitaadhikari1 ,
This is exactly the kind of scenario where
coroutines
are useful.coroutines
allow you to run (certain) items in parallel while specifying their start and end times. This allows you for example to present a series ofsketchpad
items while collecting multiple responses at the same time (by having multiplekeyboard_response
items running simultaneously).Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Thank you Sebastiaan!
I forgot to mention my experiment will be online, and unfortunately coroutines is incompatible with OSWeb. I found a code to help with my prior issue, but it is in Python and not Javascript so it is still not compatible for the online format. I am still trying to find a solution, but I appreciate your help!
Best,
Nikita
See my reply here. And please help us keep the forum clean by not asking the same question twice!
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi Sebastiaan,
I apologize about that! I thought my first question was too wordy so I tried to send it in as a shorter question, but I will make sure not to do so in the future. I appreciate your help!
Best,
Nikita