Button component data shows '1' for every trial after clicked

OS (Win10):
PsychoPy version (2022.2.4):
**Standard Standalone? (yes)
**What are you trying to achieve?: We are trying to use the button component for our study where there are boxes for each component, the participant has to click a box once each trial (0=No response, 1=Response). However, every time we run the experiment and a box is selected it will display as 1 for every trial until the study has ended, almost like it records the response and carries it over.

Capture

We want it so that it displays 1 for just that trial when it was first selected.

Also, we would also like to add a separate variable which compares the response to the correct response (0=Incorrect, 1=Correct).

We have tried changing how many clicks required (first click, every click, last click, none etc) but no change.

Any help on either of these issues would be appreciated!

Hello,

do you mind posting the relevant part of your experiment? At the moment, it looks like you posted just a screenshot of your result-file.

Do you have a variable that defines the correct response?

Best wishes Jens

You’ve correctly identified what’s going on - it does seem to be carrying over. There’s a fix for this in the next version, it’s a missing line in the output from Builder, in the meantime you can use a :code: Code component to do this at the start of each routine:

# Update wasClicked (so continued clicks at routine start are considered)
Happiness.wasClicked = Happiness.isClicked
# Clear on/off times
Happiness.timesOn = []
Happiness.timesOff = []