psychopy.org | Reference | Downloads | Github

Error with text input after update to PsychoPy3.2.0

OS: Windows 10
PsychoPy version: 3.2.0
**Standard Standalone?: yes
**What are you trying to achieve?:

I have created a task where participants are asked to provide an estimate of something happening to them, by typing in their response which is then displayed on the screen. I created this task in version 3.0.6 and it ran fine. However, the lab computers I am using have upgraded to version 3.2 and there is now an error where any text inputted by the participant appears in a long string. For example, after typing ‘3’ ‘33333333333333333333333333333333’ appears and is recorded. There is no error message produced.

I’ve created the task in builder but the written input element was created using the following code component (Note: there are limitations on the values participants can enter which is also in the following code but this part seems to be working okay, it is the text input which is causing an issue).

if len(event_like_keys.keys) > 0:
    currentText = responseText.text
    key = event_like_keys.keys.pop(-1)
    if key == 'backspace':
        responseText.text = currentText[:-1]
    elif key == 'return':
        if valence_direction == "happening":
            if not responseText.text:
                continueRoutine = True
                error_message = "Please enter a valid estimate. All events have a 3 to 77% likelihood of happening."
            elif int(responseText.text) > 77:
                continueRoutine = True
                error_message = "Please enter a valid estimate. All events have a 3 to 77% likelihood of happening."
            elif int(responseText.text) < 3:
                continueRoutine = True
                error_message = "Please enter a valid estimate. All events have a 3 to 77% likelihood of happening."
            else:
                continueRoutine = False
                error_message = ""
        elif valence_direction == "not_happening":
            if not responseText.text:
                continueRoutine = True
                error_message = "Please enter a valid estimate. All events have a 23 to 97% likelihood of not happening."
            elif int(responseText.text) > 97:
                continueRoutine = True
                error_message = "Please enter a valid estimate. All events have a 23 to 97% likelihood of not happening."
            elif int(responseText.text) < 23:
                continueRoutine = True
                error_message = "Please enter a valid estimate. All events have a 23 to 97% likelihood of not happening."
            else:
                continueRoutine = False
                error_message = ""
    else:
        responseText.text = currentText + key[-1]

Any help would be greatly appreciated.

Thank you,

Katie