Equal Random Assignment of conditions in online experiment

URL of experiment:

Description of the problem:
I have three condition files for my experiment and I want randomly assign it to each participant one condition. Additionally, I hope to assign an equal number of participants to each condition.

Right now, I have embedded a code component in my online study that randomly assigns participants into each condition, but it does not assign participants into different conditions equally.

I was thinking of doing the assignment potentially in Qualtrics as it appears that Qualtrics has the randomizer that allowed an approximately equal number of assignments, but I am not sure how I can use the randomizer to assign my participants to different conditions since I want to redirect them from Qualtrics to Pavlovia.

Does anyone have any suggestions? Thank you so much!

I also have an additional question about redirection from Psychopy to Sona. I am using Sona to recruit participants. I am having participants complete a Qualtrics survey and then they will be redirected to Pavolovia and in the end, they will be redirected to Sona such that the credits will be automatically granted. I am confused as to how to redirect the participants back to Sona from Pavlovia. Do I simply add a routine at the end for participants to click on? How do I do it? Thanks!


I use a randomiser in the Qualtrics surver flow to assign and embedded variable which I pipe to the study URL.

However I have also written a couple of tools which may help:



Best wishes,


1 Like

Thank you for your help. I have been using Qualtrics to randomly generate participant ID to my participants. Would you mind to tell me what information do you enter in the embedded variable about the randomiser in order to pipe to the study URL? I am a bit confused about that.

Then redirect to a full URL using:

1 Like

That makes a lot of sense! Thank you so much!


I hope I am not bothering you. I actually have one more question. I understand that I can add a link at the end to loop back to sona. But I am not sure how the link should’ve be composed of. Is it https://www.sona-systems.com/help/+THE PAVLOVIA EXPERIMENT LINK?

Thank you in advance for your help!

In Qualtrics I would add:

In Survey Termination Options, redirect to the full URL taken from Sona Systems in step 2, e.g.

In Pavlovia, if you added ?code=%SURVEY_CODE% to the URL then the return address would be:


1 Like

Thank you so much!

Hello, hope I am not bothering you here. Just to confirm. For the survey_code="+expInfo[‘code’]:
the ‘’ is two single quotation mark right? Thank you!

The fixed text, https://yourinstallation.sona-systems.com/webstudy_credit.aspx?experiment_id=x&credit_token=y&survey_code= is contained within double quotes, but they need to be "simple" not “intelligent”.

There’s an example in my crib sheet.

1 Like

Got it, thanks!

I know this is an old post, sorry to bother you. May I ask how you were able to get Qualtrics to randomly generate participant IDs to participants? I am brand new to SONA, Qualtrics, and Pavlovia and am having trouble figuring this out and the other forum answers go right over my head.

Hi there,

What I end up doing was I set an embedded data in Qualtrics asking it to be a random number between 1 and 10000

For my end of survey option, I ask Qualtrics to direct to my pavlovia survey adding the participant number as you can see in bold, the link is no longer active but I hope it gives you a sense of what to do. ArithComb [PsychoPy]?participant=${e://Field/participant}

Other than that, @wakecarter has a amazing program that does the job https://moryscarter.com/vespr/pavlovia.php
Hope this helps.

1 Like

What I now do is add a Quota in Qualtrics and set participant as the current count value and session as the unique ResponseID (because you can get duplicate quota counts).


Group is assigned in the survey flow using a randomiser with evenly presented elements.

1 Like