So, I posted this in a different topic (I hope that’s allowed? If not, I’ll edit the other one). But as I proposed two different solutions, I thought this simpler one might be better. Some of this is copy-pasted from the other topic, but I added some more detail.
Here is my other topic: Multiple keyboard components in one routine without using a loop
OS (e.g. Win10): Win10
PsychoPy version (e.g. 1.84.x): 3
Standard Standalone? (y/n): yes
What are you trying to achieve?:
I am creating an experiment where participants have to listen to sequences of (two types of) words, ranging from 2 w/seq to 6 w/seq. I have managed to build and code the sounds, but after each sequence, participants need to press f or j for the sounds they just listened to. So not one key per sequence, but one key per word.
I also need to know if the sequence of keys is correct, e.g. if a participant listens to a two-word sequence with the correct key ‘f, j’ then my data will only return 1 if those keys in that order are correct.
What did you try to make it work?:
So, for this one, I have one keyboard component per word: two for a two-word sequence, three for a three-word sequence, and so on. In the builder, it looks like this:
The specs of the key component look like this:
(For the last keyboard component in the routine, I would tick ‘Force end of routine’)
I even added a code component (in Each Frame), hoping it would do something (it didn’t)
# get one response per keyboard component if keySeq2_1.keys in ['', , None]: # All possible none responses keySeq2_1.keys = None if keySeq2_1.keys != None: # A response is made thisExp.nextEntry()
What specifically went wrong when you tried that?:
My experiment runs, and I get no error code in my runner, but there is no rhyme or reason as to when my routine ends. Or, maybe better put, when PsychoPy goes from one keyboard component to the next. I changed Store from “first key” to “all keys” just to see what happened and my csv file showed me some very interesting things I have no idea what to do with.
I’m not going to upload all of my trial runs, but they all look different: some long, some short, some don’t even have a response in keySeq2_1.keys.
So my actual question is: is there some code that will tell PsychoPy to go from one component to the next as soon as a response has been given?