Here’s a new method I’ve just written and added to my Online Demos.
Randomisation without repetition code | try it
This demo presents a new method of randomising a set of trial types without consecutive presentation of the same type. Instead of loading the trials into a list and then shuffling until a suitable order has been created, it skips consecutive presentations and then repeats the loop only selecting those trials. Since there is a danger that doing this on the fly can end up with an insoluble problem (for example, the final two trials are of the same trial type), this method will add an extra trial into the new list. The participant may therefore end up seeing one or two additional trials in the experiment, but they can easily be excluded from the analysis if desired, using column that records the presentation number.