Randomizing in Self Paced Reading

Hi everyone,
I’m trying to create a self-paced reading experiment on Psychopy. I have 24 experimemtal sentences, 24 experimental yes/no questions regarding the experimental sentences and 24 filler sentences. The sequence of the items should be; first experimental sentence (word by word), second experimental question (not word by word), third filler sentence.
So we can say that each set consists of 3 different sentences.
I want these sets to be randomized.
When I select “random” within the loop, All of the words in the set list are randomized and the experiment becomes meaningless. All the words in my Excel sheet appear random. But I want my sets to be randomized, which means one meaningful sentence, one meaningful question and one meaningful filler.
I hope I expressed myself clearly.

Thank you

Should question 1 always go with experimental question 1? And filler 1? Or should they all be randomised independently?

Yes, experimental sentence 1 should always go with the experimental question 1 because each sentence has its own yes/no question. They are interrelated. Yes/no questions’ content is about the sentence that is previously shown. But filler sentences can be randomized independently since they are independent sentences from the experiment.
Let’s make this more clear;
Let’s say the experimental sentence 1 is: Humans have a complicated logic system.(These words should appear on the screen word by word.)
Experimental yes/no question would be: Do humans have a complicated logic system? (Doesn’t have to appear word by word)
Then comes the filler sentence (totally random): I saw a cat today. (Doesn’t have to appear word by word)
And then the experiment goes on with the 2nd sentence, its question and filler. And so on.
The problem is I can do this sequentially but not random. For example, I want the 14th sentence, its question and filler to appear first in the experiment, then let’s say 20th sentence, its question and filler, then 2nd sentence, its question and filler. I want these sets to be randomized.
There could be a problem both in my Excel sheet and Psychopy. I’m not sure.

I hope it’s more clear now.
Thank you

Hello @bilge_ilhan

How did you set up your Excel sheet? I assume a column for each kind of stimulus?

You could have a look at PsychoPy Online Demos for a way to realize independent randomization.

Best wishes Jens

Hi

This is how I arrange my Excel sheet;

This is how I arrange PsychoPy;

The codes I use are;
wordList = sentence.split()
wordIndex = 0
wordText.text = wordList[wordIndex] on the Begin Routine screen.

keys = nextKey.getKeys()
if ‘space’ in keys:
wordIndex += 1
if wordIndex < len(wordList):
wordText.text = wordList[wordIndex]
else:
continueRoutine = False on Each Frame screen.

And then when I run the experiment, runner replies with;
Traceback (most recent call last):
File “C:\PsychoPy\lib\site-packages\psychopy\iohub\start_iohub_process.py”, line 118, in
Computer.psychopy_process = psutil.Process(psychopy_pid)
File “C:\PsychoPy\lib\site-packages\psutil_init_.py”, line 319, in init
self.init(pid)
File "C:\PsychoPy\lib\site-packages\psutil_init
.py", line 368, in _init
raise NoSuchProcess(pid, msg=msg)
psutil.NoSuchProcess: process PID not found (pid=9060)
################# Experiment ended with exit code 1 [pid:9060] #################

I have no idea what that means. And I have used AI for writing codes.
What do you think?

Hello @bilge_ilhan

This is a different problem than the problem you mentioned above. AI is not very good at helping you to program PsychoPy-experiments.

Where you define nextKey?

Do you allow other keys than spaceto end this routine? If not, you could just compare the number of presented words with the number of key presses.
In Begin routine add

nWords = len(wordList)
if key_resp_1.keys:   # is there any response yet
    wordNum = len(key_resp.keys)
    if len(key_resp_1.keys) == wordIndex & wordIndex < nWords:
        word = words[wordIndex]
        wordIndex += 1
if wordNum == nWords:
    continueRoutine=False
    word = " "

Best wishes Jens

Try changing the Experiment Settings/Input to Psychtoolbox