in the “end routine” tab used to work perfectly but suddenly it started to terminate the whole experiment instead of skipping to the next routine while giving a “KeyError.”
(raise KeyError(key) from err
KeyError: 5)
I tried adding this part to the “begin routine” tab but it didn’t help.
.thisN is usually an integer not text. However, I feel like I have come across this issue. Are you using any other code related to the loop, such as rewind trials?
Thank you both! Unfortunately, quotation marks didn’t work.
The task is a dot task where two circles with different numbers of dots are presented on the left and right sides of the screen. I have the following codes to tell PsychoPy to randomly choose images of these circles from randomly chosen folders.
I’ve checked my records and found that I got a weird Key error of the next iteration number when using trials.finished = True in one particular experiment (sentence repetition) in a bespoke PsychoPy environment but it was fine in others using the same version. I fixed it by implementing trials.skipTrials(nConditions - trials.thisN).
Please could you send me your psyexp file so I can try to replicate the issue?
it might seem a bit messy but if you help me figure out what to do with the practice loop, hopefully i will take care of the rest! do i need to send other excel files or image folders as well?
I’m surprised that this bug hasn’t come up more often. Here’s a minimal demo that still shows it.
It seems to be related to saving the data from a loop and this still gives the error in our pre-release versions so it hasn’t been fixed yet. On the other hand, it doesn’t seem to always occur whenever .finished = True is used so there must be something different about this demo experiment from others I’ve tried.
Well, I guess you’re right! I just changed the data-saving settings and “.finished = True” works without a problem when “Save Excel File” isn’t checked. I suppose this is an error about the new version of PsychoPy.