If this template helps then use it. If not then just delete and start from scratch.
OS MacOS Sonoma 14.0
PsychoPy version 2023.2.3
Standard Standalone? (y/n) Y
What are you trying to achieve?:
I’m attempting to run a vowel identification task (participant hears a vowel in a carrier sentence and clicks the word containing a rhyming vowel). There are 5 on-screen response buttons and the mouse is locked to a dock until a certain time passes which then frees the mouse for them to click.
I’ve done a ‘practice’ module here that gives feedback (I’m still in the process of updating how the feedback works, but the error described here is making that tedious). The implementation of the feedback isn’t quite right yet, but here’s the issue gumming up testing it:
I evaluate where each trial is correct at the end of the Trial routine in a code chunk “checkCorr” and then use info from there to update the feedback routine that come next.
What did you try to make it work?:
I’ve inserted this code chunk where intPhon is a variable in my conditions file.
if mouse.clicked_name[0]==intPhon:
correct = 1
else:
correct = 0
What specifically went wrong when you tried that?:
It works great most of the time. I have successfully run through one or two blocks of trials a number of times, but sometimes it will stop and give the following error (screenshot below, copy paste isn’t working): ''if mouse.clicked_name[0]==intPhon: IndexError:list index out of range".
vit_err_toshare.psyexp (75.6 KB)
It should only be accepting valid clicks, which are named identically to the values in intPhon. It works marvelously most of the time, so it appears to be doing that.
I can’t find a rhyme or reason to when the error occurs: it happens on correct and incorrect responses, for different items in the list, at different trial numbers, on the first and second loop.
Any insight is much appreciated. I’ll attach the psyexp file here as well.
Include pasted full error message if possible. “That didn’t work” is not enough information.