@Bruno_Dalpiaz, great. I think I have a solution to your randomization problem. @Michael shows how to randomize routine order in this response here.
Routine randomization
You need to include another conditions file in your Tarefas_loop
which conditionally presents a routine using binary indicators - see attached nnReps.xlsx sheet. The columns in the sheet are nReps1:nReps3 and a 1 indicates to present a routine and 0 indicates to not present a routine. So, you go to your routine loop of interest e.g., Dilemas_A_loop, and in the field nReps
you enter nReps1 as a variable. Do the same for your other routines e.g., for EMRI, enter nReps2 in the nReps
field. This controls the randomization of your routines (so long as “Random” is selected in the Tarefas_loop
.
Introductory text on each routine for first iteration only
To ensure instructions appear on your first iteration of the experiment only, see the code component in the attached Builder file - we will use EMRI as an example. In the code component, you need to initiate a counter at the beginning of the experiment:
cancelEmriText = 0
Then, add the following at the beginning of a routine, to ensure the text is only written on the first iteration:
if Tarefas_loop.thisN <= 2 and not cancelEmriText > 0:
cancelEmriText = cancelEmriText + nReps2 # nReps2 because see EMRI loop handler
emriText.setText("Intro to EMRI")
emriText.setAutoDraw(True)
win.flip()
else:
continueRoutine = False
pass
Then, at the end of the routine, turn off autodraw:
if cancelEmriText > 0:
emriText.setAutoDraw(False)
win.flip()
Repeat for all your routines - but see attached example. You will have to flatten your data for each participant, as you will have several rows for each trial, but that is easily processed. There may be a better way to store the data.
experimentoJMA_example.psyexp (56.6 KB)
nnReps.xlsx (8.6 KB)