Hello all,
I am trying to create an auditory digit span task, where participants will hear the stimulus (digits 1-9) being read out loud, and will respond accordingly. I am running PsychoPy 3 on Windows, using primarily the Builder with some Code Components in between.
The following are the constraints of the test:
- There will be two types of assessment: forwards (FA) & backwards (BA).
- The baseline number of stimuli per trial is 3 for FA and 2 for BA. For example, a trial with 3 stimuli would be 4 - 8 - 1 being read aloud consecutively.
- A response is correct if responded in both digits and order of presentation. For example, a 4 - 8 - 1 response for the trial above, in that exact order (this is for FA, while for BA the correct response = 1 - 8 - 4)
- If a correct response is given, the next trial will increase by 1 digit (e.g. the next trial will have 4 stimuli, for the trial above).
- If an incorrect response is given, the next trial will remain with the same amount of digits.
- If two consecutive incorrect response is given, the next trial will decrease by 1 digit.
- There will be a total of 14 trials each for both FA & BA.
- By default, participants run through the forward assessment first, then backwards.
The following is what Iâve done so far:
- I have created a loop for the stimulus presentation (Stimulus_Trials looped by Stimulus_Loop, surrounded by Fixation_Block_Start & Fixation_Block_End) that is attached to an Excel conditions file (with the stimuli digits 1-9 in the corresponding rows linked to a .wav sound file, and a correct answer column corresponding to the sound file digits). This loop is in a random order (sampling without replacement from the .wav stimuli list), with the number of repeats (total stimulus per trial) dependent on the participantâs performance on the previous trial, starting with 3 on the first trial.
Here is my stimulus .xlsx file:
Stimulus.xlsx (8.4 KB)
- Following this is a pair of routines surrounded by a loop. The first routine is to intake a keyboard response constrained by key presses 1-9, and the second routine is to display a feedback to the participants for the key pressed. The loop is there to intake the responses corresponding to the total number of stimuli for that particular trial.
- The above works without issues, and I am able to iterate the first trial (3 stimulus loop presentation) and the response routines (able to retrieve the corresponding correct answers in the response loop)
Here is my experiment flow:
The problems I am facing:
1. I am having trouble creating a custom adaptive staircase that is able to handle the conditions above. Specifically, this staircase should be able to identify if the participant has entered a correct response (FA: 4 - 8 - 1 // BA: 1 - 8 - 4) for the first trial and increase the level by 1 (4 stimulus being read aloud for the next trial iteration). Conversely, if the response was incorrect, the next trial should be at the same level. Lastly, the next trial should decrease by 1 level after every 2 consecutive incorrect responses. The problem is that I do not know where I could add a custom code component to make this specific loop/adaptive staircase, and what that code should look like.
I am able to extract correct answer responses via the variable Response_Trials.corr (that compares with the variable corrAns from my Stimulus.xlsx list) from the data file output, but only for FA right now.
Here is a sample of the data file output (column AJ: Response_Trials.corr = 1 per stimulus, but the actual âcorrect answerâ must be that all Response_Trials.corr = 1 for every stimulus in that trial):
001_Auditory Digit Span Task_2019_Jun_05_1704.csv (3.9 KB)
2. This adaptive staircase should switch to BA after 14 iterations/trials of FA. I think it should continue as a separate routine/loop in the experiment flow, as the input for correct answers only accounts for FA? I believe this would be cleaner than inputting a code to repeat the routine after FA?
Here are my interleave staircase options & staircase conditions .xlsx file:
Conditions_Staircase.xlsx (8.1 KB)
Lastly, I have attached the PsychoPy experiment file & .wav audio stimulus for reference.
Auditory Digit Span Task.psyexp (43.8 KB)
Any help would be greatly appreciated - if you could point me in right direction, or some online tutorial is building something like this.
Cheers!
D