Between-subject counterbalancing via pavlovia

From what I’ve learned, I don’t think sequential ordering is possible with conditions. Your best option would be to create two separate .psyexp experiments and share the link sequentially for each signup.

If, however, you are able to use the same experiment and simply change the .xlsx file, you can write a piece of code that will randomize which file (condition) is chosen. Then you can just keep a tally on each condition until a certain quota is reached, and continue experiments using the other file.

I’ve created four excel files called OrderA.xlsx, OrderB.xlsx, OrderC.xlsx, OrderD.xlsx. When specifying the condition in the trial loop, write: $'Order' + condition + '.xlsx'. The “OK” button might grey out but if you keep trying, it’ll become available.

Then create a code component in the same routine, and under the Begin Experiment tab, write:

Python

import random
condition = random.choice(('A','B','C','D'))

JavaScript

function random_character() {
    var chars = "ABCD";
    return chars.substr( Math.floor(Math.random() * 4), 1);
}

condition = random_character(); 

If you only have two conditions, arrange accordingly, but in the Javascript code, make sure that (Math.random()) takes “2” instead of 4.

Hope this helps.