Help with randomization parameters

I am conducting a classical conditioning experiment in which three colored squares are presented to participants in the computer screen. Two of these pictures are paired with a mild electrical shock in approximately 1/3 of the trials, and the third is never paired with the shocks. I would like picture presentation to be random, but there has been times in which the same stimulus appeared three times in a roll during the experimental session. In my experiment, a stimulus cannot appear more than two times in a roll. I know it is possibile to randomize trials in a block once per participant, once per group or every time the block is presented, but I could not change this parameter.

Can anyone help me with this?


Is there anyway I can take a look at your experiment? Do you know if you are using the most current version, SuperLab 4.5.4? If you can post your experiment as an Experiment Package that would be helpful. This is found under the File menu within SuperLab.

I am using the 4.5.3 version of superlab. I have attached the experiment so you can take a look.

Thanks (34.6 KB)

I have attached a modified version of your experiment. Code values were created, one for each of the colors. Under the block level three macros were also designed. Look through the expressions and the If True and False tabs within the macros to see how they are being used. Also, under the trial level an expression was created to tag which color was presented.

Dia1_Pareamento (13.1 KB)


I have run the updated version of the experiment and it is working perfectly now. It is also clear to me now how to use the expressions and macros. I think this will be enough for the purposes of our experiment.

Thanks for your help

Hi Monika,

I am conducting an experiment in which two sets of stimuli need to be presented eight times each in a random order. One feature of this experiment is that trials cannot be presented more than two times in a roll. I have attached different codes and expressions in the trial level to tag which stimulus was presented. Also, I have used two macros to check which stimulus was presented in the previous two trials. Al of this was based on a previous experiment you have helped me with.

Using these codes and macros, I was able to prevent trials from being presented more than two times in a row. However, some trials are not presented at all during the experiment. Fo example (trial A is presented 7 times and trial B 6 times). I am not sure what I am doing wrong and I would like some help to fix this problem.

I have attached an experiment package so you can see my experiment.


Sorry, I forgot to attach the file. Here it is. (235 KB)

Currently in your design, if a trial contains a stimulus that was just presented two times in a row, it will be skipped. The key note to point out here is that this trial will be skipped indefinitely.

Because you only have two stimuli, each presented eight times, it is likely that the same stimulus is presented back to back when randomized. This is why you do not see the full sixteen trials when running the experiment.

To solve this problem, you must create codes for the test trials that denote whether or not the trial was presented, and only present these trials if the code value is “no”. Then, you must create a macro that will repeat the block until all trials have the code value “yes”.

I would suggest upgrading to SuperLab 5. Parameters and simple-to-use looping options make implementing this design much easier.

I just came across this with the same question, i.e., limiting a trial type from repeating over two successive trials. I haven’t found how to do this with Superlab 5, though. Any help is appreciated.

jcroot, I have attached an experiment that should be helpful to you.

For this design, each stimulus type should have its own trial, stimulus list, and count parameter.

Upon each presentation of a certain type, its respective count increments and the other counts reset, like so:

Trials should only be presented when the counts are less than two. This will limit stimulus types from repeating over two successive trials.

limitRepeats.sl5 (5.76 KB)