psychopy.org | Reference | Downloads | Github

NameError: name 'x' not defiened

Hey.

In my experiment i wanted to create a free recall, where the subjects can type in everything they remember, with a time limit!!!
My problem now, all the time I run the experiment this special deficiency report appears and the experiment terminates immediately…

Does anyone knows what i have to do or to tip into the Code-File?

Thanks a lot.

Obviously, x does not exist. Without more information about what x is supposed to be and how and where it should have been created, we can’t be of much help, I’m afraid.

Okey. Unfortunately I have not that much experience with Psychopy. All I wanted was to create a Routine, where the subjects have to tip in some words and after 1 min the Routine finishes and the experiment goes on with another Routine. How would you do that?

If necessary I could also upload my Psychopy Builder…

To do this in code, you would just do this:

if t >= 60.0: # if a minute has elapsed
    continueRoutine = False

But you can probably get this behaviour graphically by simply setting all of your stimuli and other components to have a duration of 60 s, avoiding the need for this code.

I tried it but it didn’t work…
I send you my file with the Routine, maybe you could try to insert the code…
Thanks
Free recall (2).psyexp (13.0 KB)
textinputExp-w-r.xlsx (30.4 KB)

Replace this:
x.finished = True

With this:
continueRoutine = False

And change the 5 to 60 when you want it to wait the full minute.

But as Michael says above, it would be simpler to remove this bit of code and give the text and key response a limited duration.

Thanks a lot. It worked :wink: