| Reference | Downloads | Github

Randomisation of condition selection in a loop


Appologies, I had to remove this post for now. Will get back when ready, and avoid waisting your time.


Hi @boussaoud, have you tried the Stroop tutorial? See here.


Hi David, yes I followed the tutorial in that video.
Perhaps this problem has been fixed in more recent versions of PsychoPy? I am using 1.90.2
Best. Driss


@boussaoud, it is not a waste of time, please feel free to post your questions so we can help.


Thank you. Actually, I must re-state my question.

In my Stroop task, English (in Latin letters) and Arabic (in arabic letters) words are mixed in the same conditions file.

Because PsychoPy could not (a priori?) write in Arabic letters, and will not switch between languages during the task, I created images of the words, written in French or in Arabic. For example:blueGreenEn
or blueGreenAr

In the conditions file, each row corresponds to a “trial”, with a unic associaiton between an image and response.

My Problem is the following:

For the Stroop experiment to be appropriate, consecutive trials need to switch color: if color was green in trial “n” (independent of language), it should not be green in trial “n+1”.

I don’t see how to tell PsychoPy to take into account “color” in this situation.

Any idea?

Thanks. Driss


Here is a complement to my post (I could not insert more than 2 images):
Conditions file


Dear Driss,

Firstly, PsychoPy should now be capable of displaying Arabic text properly. If not, we’d like to know about any issues and fix them. Are you using the current version? The ability to correctly display Arabic was added to the codebase in Aug 2018, and would have become publicly available in a release soon after that:

Would you mind trying out using text with the latest version and get back to us? It would hopefully greatly simplify this and future studies for you. The only thing you need to do is click on the “Advanced” tab of the text component and select “Arabic” as the text style. I think you should still be able to use English text in the same component on different trials.

Secondly, Builder can’t easily implement constraints like preventing consecutive presentations if you are using its random ordering features (it just takes the conditions file and shuffles its rows).

If you need randomisation with constraints, then you need to do one of two things:

  • find someone who can program those constraints for you, replacing Builder’s standard randomisation.
  • make a selection of your own manually-crafted random-but-constrained conditions files, and switch between them for different subjects.


Dear Michael,
Thank you very much for your feedback. I just downloaded the latest version, and I will try it and get back to you.
Best. Driss


Dear Michael,

I switched to PsychoPy version 3.0.0, and I can now display words in both Arabic and English.
This is a very useful capability, thank you!

Now, I still have to solve my initial problem: the repetition of words with the same colour. I will ask for help around me, and try the first option you suggested.
Will let you know when this is solved.
Thank you again.