OS Windows 10
PsychoPy version v2021.1.2
Standard Standalone? (y/n) Yes
What are you trying to achieve?: Program a typed response task
What did you try to make it work?: Watched How to get typed responses in PsychoPy - YouTube and How to check if a typed response is 'correct' in PsychoPy - YouTube, and read through blog posts on similar issues.
What specifically went wrong when you tried that?:
I have two issues: 1) the Mouse functionality isn’t working and 2) my TextBox responses are not immediately accessible.
When I include the mouse component per the videos above, I get the following error message
Traceback (most recent call last): File "C:\Users\KUbsadmin\Desktop\test\test_lastrun.py", line 490, in <module> if obj.contains(mouse): AttributeError: 'list' object has no attribute 'contains'
I put the correct clickable stimulus (
endButton) per the videos, so I don’t think that’s the issue.
If I remove that and just use a timed routine termination, I can’t test whether the typed response is correct, which I need in order to terminate the loop and move on. I ask the participant to type in a three-digit integer, so I when I try the following code:
if int(textbox.text) == corrAns: trials.finished = 1
I get the following error message:
Traceback (most recent call last): File "C:\Users\KUbsadmin\Desktop\test\test_lastrun.py", line 496, in <module> if int(textbox.text) == corrAns: ValueError: invalid literal for int() with base 10: ''
Which makes me think the textbox.text response is not being stored.
Any help with this would be greatly appreciated!! @Becca I think you made the original videos so I thought I’d tag you and get your opinion!