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.
- 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 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.
-
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.
Here is my experiment flow (I have yet to add the adaptive staircase loop surrounding the Experiment_Trials & Response_Feedback routines):
The problems I am facing:
- The .csv data output file seems to only be correctly comparing the correct answers for the last response of the response loop, while all previous response being stored as incorrect. I have troubleshoot and confirmed that the corrAns variable works as intended, and the comparison of correct answer to participant response being done by the code also works. However, it only works for the last iteration of the loop, no matter how many times the iteration count is.
Here is the keyboard response properties for that routine:
Here is the Excel conditions file from which both the audio stimuli is being drawn upon & the correct answer list:
Here I have attached the code for the loop surrounding the above response routine. (Note: Response_Trial_Loop is the response loop, while defaultN is a variable I use to track the loop)
Finally, I have also attached a dummy data output file that better illustrates this problem.
001_Auditory Digit Span Task_2019_Jun_04_1236.csv (2.5 KB)
- I have yet to attempt to create the staircase loop because of the problem above, as it would depend on the correct/incorrect response from participants. In any case, I would appreciate it if I could be advised that the direction I am heading towards is correct.
Here is the PsychoPy experiment file as well.
Auditory Digit Span Task.psyexp (41.4 KB)
Thank you so much in advance!
D