psychopy.org | Reference | Downloads | Github

Repeating a subset of trials in a single loop in a random order

I have an experiment where I am presenting faces along side certain money transfer conditions. Each face is presented with two money transfer conditions (self gain and charity gain). I have a total of 64 faces. I also have 16 conditions that I want to repeat 4 times so that there is a money transfer associated with each face. I want to do this in a random order. So far I had the 16 conditions copied into my excel sheet 4 time so that there was a condition with each face, and then i used some code to randomize the two lists of self gain and charity gain conditions. However, this did not end up with each of the 16 conditions repeating 4 times. In addition, after the 64 trials i get an index error and the experiment doesn’t go to the recall faces.

How can i ensure each of the 16 conditions only repeats 4 times? And is there anyway to address this index error?