psychopy.org | Reference | Downloads | Github

Selecting only one item from a list (repeatedly)

Hello everyone!

I am a beginner in PsychoPy (using PsychoPy v1.90.2 with Python 3.6) and I’m having troubles setting up one section of the experiment. I’m trying to build the following task: The participants will be presented aurally with 36 novel verbs in total. Each of the non-words is implemented into 3 different frame sentences to control for any possible semantic effects.

My PsychoPy flow looks like this, using two loops:
1

The outer loop (blocks) condition file includes links to 36 different .xlsx files (one for each nonce word):
2

In the inner loop (trials), the routine is told to choose one of those files randomly:

When it chooses (and opens) one of the .xlsx files (see the open file),
5
I want it to choose randomly ONLY ONE of the following rows (i.e. one of the frame sentences in which the non-word is implemented), play the recording, leave the file, randomly choose another of the 36 (now only 35) .xlsx files, and again randomly choose only one row in the file. This cycle should be repeated 36 times with all 36 non-words.

Now, in the sound_3 stimuli (test), I have the following setting:

However, this setting does only this: It chooses one of the .xlsx files randomly (which is great) but it plays ALL THREE recordings in the file (it chooses all rows, not only one). I need to tell PsychoPy to choose randomly ONLY ONE of them and move onto another file.

Could anyone please help me? (A dummy-version explanation will be very much appreciated. :blush: )

Thanks a lot!
Lucka

It has actually helped to create a short code component that aborts the loop after presenting a single recording.
I’ve put this in the End routine tab: trials.finished = True.
And it seems to be working! :slightly_smiling_face:

1 Like