Have a look at my proposal on another thread here: Two types of image stimuli, 9 of each, want experiment to randomly select four of each kind for every trial
Have a look at my proposal on another thread here: Two types of image stimuli, 9 of each, want experiment to randomly select four of each kind for every trial