pageasfen.blogg.se

End routine after number of keypresses psychopy builder
End routine after number of keypresses psychopy builder











end routine after number of keypresses psychopy builder end routine after number of keypresses psychopy builder end routine after number of keypresses psychopy builder

But to keep this experiment relatively simple, our current instructions suffice and we’ll only work with two colors (green and red).Īdd a new routine, named stim, with a text stimulus ( trial_txt) with the word “red” in the color red and font size 0.2, which terminates after 5 seconds or when the participant presses the left or right arrow key (for which you need to add a keyboard component!) and is followed by a new routine, named isi, which shows a fixation dot (like in the init_fix routine we created before) for 0.5 seconds. Also, you probably want to use a larger variety of color-word pairs to increase generalizability (see, e.g., Westfall, Nichols, & Yarkoni, 2017). If this were a real experiment for your master thesis, for example, we’d recommend adding some more detailed instructions and practice trials. Now, run the experiment again and check whether the instruction routine works as expected! (Note: because the instruction routine is the experiment’s last routine, it may seem that the experiment doesn’t advance immediately after pressing enter, but that’s because it takes a second or two to quit the experiment after the last routine due to saving data and such.) If you did the ToDo correctly, you should see a new keyboard component in the instruction routine which similarly extends beyond the time axis of the routine pane (indicating that it does not have an offset). Make sure the stop property is left empty and that it ends the routine when the participant presses the return key (i.e., use “return” for Allowed keys). When enabled (the default), it will end the current routine and move on to the next whenever one of the allowed keys is pressed, which is exactly what we want for our instruction routine!Īdd a keyboard component to the instruction routine. The property Store correct is not relevant, here, so we’ll ignore that for now.Īnother important property, especially in our current use case, is the Force end of Routine option. In addition to some standard properties (like name, start, and stop), the keyboard component also has the property Allowed keys, which specifies which keys are recorded and affect this component, and Store, which specifies which of the potentially multiple key presses should be saved. To implement this, we’ll need to add a keyboard component. As mentioned, we’d like to continue the experiment if the participant pressed the return key. This is highlighted in the routine pane by the bar corresponding to the component extending beyond the time axis. The effect of leaving the stop property empty is that you, technically, create a component with an infinite duration. Give the component a sensible name, keep the letter height at the default (0.1), and leave the stop property empty. Importantly, you need to respond to the COLOR of the word and you need to ignore the actual word. In this experiment, you will see words (either “green” or “red”) in different colors (also either “green” or “red”).













End routine after number of keypresses psychopy builder