I am trying to build a serial reaction time task (SRTT) with psychopy.
In the SRTT paradigm, four rectangles will be arranged horizontally on computer screen. At the beginning of a trial, one of the four rectangles will change from light to dark. Participants will be instructed to respond as quickly and accurately as possible, by pressing the corresponding button of a standard computer keyboard - “v” “b” “n” or “m”.
The SRTT involves “random trials”. Each “random trial/” will consist of a randomised series of 12 stimuli - 3 repetitions of the keys “v” “b” “n” and “m” (e.g., one trial might be: v-m-n-b-v-n-b-m-n-b-m-v).
My problem is that the “random trials” must NOT include consecutive presentations of one letter (e.g., v-m-n-b-v-n-n-m-b-m-b-v). After searching the discourse, my understanding is that I need to generate a custom code to ensure that this does not occur. However, I am very new to psychopy/coding and am not sure of how to do this.
Is anyone able to please help guide me in generating a code that will constrain the randomisation process so that no one square/keys be presented consecutively?