Hi all, I am trying to figure out a way to have button components that need to be clicked in a certain order in order for participants to advance to the next trial. Any help would be greatly appreciated.
Hi Will,
I currently use polygons rather than buttons just because buttons still have some bugs online (they should be fixed very soon). But here is a demo for how you could achieve this with clickable polygons.
This demo presents 3 shapes and asks them to be clicked in a specific order. The routine with the shapes has a repeat
loop around it with a large number of repeats.
The routine has a code component where in the Each Frame tab it checks if the desired number of clicks have been made:
if len(mouse.clicked_name) == 3:
continueRoutine = False
Then in the end routine tab it checks if the order of clicked items was as desired, if yes it ends the repeat loop to move onto the next trial. If not it will repeat the trial.
desired_order = ['circle', 'triangle', 'square']
if mouse.clicked_name == desired_order:
fb = 'correct'
repeat.finished = True
else:
fb = 'incorrect'
Hope this helps.
Becca
custom_button_order.psyexp (25.9 KB)
Hi Becca,
Thank you for the reply, this demo and code will help with my experiment tremendously! And thank you for the YouTube tutorial videos, they have been a huge help as well!
Thank you
Will