psychopy.org | Reference | Downloads | Github

Clickable button fails

OS: Windows 10
PsychoPy version (2021.1.2):
Standard Standalone? (y/n) Y
What are you trying to achieve?: I’m building a simple experiment that has two tasks that loop through a number of trials detailed from an Excel sheet

What did you try to make it work?: The first task is a rating scale that when clicked on goes to the next task which is a textbox. In the textbox task, I have tried three different methods to move to the next trial: mouse-click on a text-button, keyboard tab, and the new clickable button in the latest version.

What specifically went wrong when you tried that?: All three of these options exit the experiment instead of moving to the next trial.

Here is the error message:

  textbox.reset()
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\visual\textbox2\textbox2.py", line 651, in reset
    self.text = self.startText
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\visual\textbox2\textbox2.py", line 358, in text
    text = text.replace('<i>', codes['ITAL_START'])
AttributeError: 'NoneType' object has no attribute 'replace'
##### Experiment ended. #####

Here is a screenshot of the experiment. Notice the button component. When it is clicked on, instead of moving to the next trial, it exits the experiment.

Hi There,

This is a bug in the new release where using the button component exits a loop. I am flagging this as an issue to the team and we will hopefully have a fix soon.

Becca

Thank you, Becca. Unfortunately, the same issue happens when I use a mouse-click or a keyboard click to end the routine- both end up exiting the loop. Is that part of the same bug?

Hi There,

The keyboard component should be totally fine, please could you share your .psyexp file for us to take a look?

Thanks,
Becca

Hi there,

I’ve had what may be a similar issue trying to add textbox2 to my experiment. No buttons here, but anyway it looks like the OP’s error is has something to do with textbox2 as well.

EDIT: My solution was to add a space in the default text for my textbox; this got rid of the error. Also, changing the units from ‘norm’ to ‘height’ might help (see this thread)

Traceback (most recent call last):
  File "__[redacted]__lastrun.py", line 2523, in <module>
    freeRecallResp.reset()
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/visual/textbox2/textbox2.py", line 651, in reset
    self.text = self.startText
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/visual/textbox2/textbox2.py", line 358, in text
    text = text.replace('<i>', codes['ITAL_START'])
AttributeError: 'NoneType' object has no attribute 'replace'
##### Experiment ended. #####

My routine: