How to randomise the polygon stimulus?

OS (e.g. Win10): Win10
PsychoPy version (e.g. 2024.2.4 Py 3.8): 2025.1.1
Standard Standalone Installation? (y/n): y
What are you trying to achieve?:

I am trying to create a stop-signal reaction time task with four different coloured circles. I have created the circles using the polygon stimulus, and want to randomise their colour - one loop for each learning section (which will happen in three blocks, where ppts will learn the associations between the colours and buttons); and one for the main task.

The only guidance on randomisation I can find is to do with image stimuli, rather than polygon stimuli. I would much rather use polygons as it makes it easier to standardise the size of the circles.

I apologise for the simple question, I am new to PsychoPy! If anyone has any guidance on how to randomise polygons that would be greatly appreciated.

You could have the colours of the polygons in a list and then randomise the order of the list.

e.g.

colours = ['red', 'green', 'blue']
shuffle(colours)

then put the colour as $colours[blocks.thisN]

Thank you for your reply!

I don’t know how to code unfortunately, do you have any tips on how to do this in builder; or where to place this code?

Try creating a code component (in Builder) and adding this to the Begin Experiment tab.