Digit Span (online)

OS: Mac
PsychoPy version: 2024.2.4
Standard Standalone Installation? (y/n) Yes
Do you want it to also run online? (y/n) Yes
What are you trying to achieve?: I have the code ready to go but I can’t for the life of me figure out why it does not want to run properly.

What did you try to make it work?: I followed along this video: https://www.youtube.com/watch?v=KPA2Iw5XH7c

What specifically went wrong when you tried that?:
unboundLocalError: local variable ‘counter’ referenced before assignment

So I can’t even run to see if it works - it crashes.

Here is the code:

Digit_Span_Task.psyexp (54.8 KB)

series_length.xlsx (8.6 KB)

If anyone would like to help me that would be amazing. Thank you so much!

Hello @Psytina

Initialize the variable counter in a Begin Experiment tab.

Best wishes Jens

1 Like

I thought I did with counter = 0, no?

1 Like

What tab is it in! Is it indented (in Python)?

1 Like

I moved the code - thanks to Jens!! - into the Begin Experiment tab and this problem seems solved now… now I have a different issue… :face_with_bags_under_eyes:

1 Like