How to add consent forms to online task + how to randomise versions of tasks online?

Description of the problem:

Hello! As many scientists during the Covid-19 crisis, I am looking to move my experiments online using Pavlovia.

I am faced with two issues:

  1. How would I be able to add a consent form, information sheet, + one or two questionnaires to my experiment?
  • Is there an option in adding those on Pavlovia, or PsychoPy builder? (I solely used the builder to create my tasks, and do not have a great understanding of the underlying code).
  1. Counterbalancing
  • to give some context, my study consists of 2 tasks, a visual and an auditory version of the task. Due to counterbalancing of the stimuli, I created 3 versions of the visual and 3 versions of the auditory task, ensuring stimuli are presented in different orders and as different conditions etc.

By moving my tasks onto Pavlovia, I wonder if there is an option to randomise which version of the task a participant will get, and ensure they would to both a version of the visual task and a version of the auditory task, even they are seperate PsychoPy files.
Would this be possible at all using Pavlovia? or perhaps something like Prolific even?

I am first year PhD student and only started using PsychoPy builder recently, so I am quite new to this. Any help and suggestions would be greatly appreciated.

Many thanks!

There are a lot of options on what to do about the consent form etc. The most commonly used approach is to give those at the start of the experiment as text and then saying something along the lines of: if you agree with the conditions, press start. So doing the experiment is basically consenting.

Counterbalancing the experiments can be easily achieved by creating different experiments for each option (i.e. version 1 visual, version 1 auditory; version 1 visual, version 2 auditory etc) in the recruiting platform so that you ensure an equal number of participants for each. But there may be simpler ways of doing this.

Thanks for you reply and suggestions for obtaining consent! Do you have any ideas or suggestions on how to best add in a questionnaire however?

Regarding the counterbalancing, I already have different experiments for each version. My concern is ensuring that each participant would do 1 visual experiment and 1 auditory one - but they are seperate files at the moment.

You can add a consent form at the beginning with something such as “press ‘y’ if you agree and want to start / press ‘n’ if you disagree and want to quit”. You will need to add a keyboard component with the clicks “y” and “n”. After that you can add a conditional loop such as the experiment continues if “y” was clicked and quits if “n” was clicked.
For the questionnaires I added a qualtrics link at the end of my experiment (you can do this in the experiment settings, completed/incompleted URL), the survey tool called “form” in Psychopy is not supported in Pavlovia.

@sophiecambridge I agree with what @aelreym said about the consent form and the questionnaire. I would opt out of using any form in Psychopy, I would use any form of questionnaire, even google forms would work depending on what you want and whether you have a license with qualtrics/prolific etc.

About the counterbalancing, it highly depends on how you are going to recruit, you can just build the experiment in prolific for example, and give the url for each task. So experiment one would give the links for visual 1 and auditory 1 for example. But you can always try to merge them manually, but it may lead to more errors when uploading to Pavlovia depending on the level of complexity of the tasks.

Hi, I’m having the same problem with consent forms and am setting up the conditional loop so that the experiment ends if “n” is clicked. I’m having trouble with the code, can you please share with me the code for this? I’ve tried:

if (textAdd === ‘n’) {
textAdd = ‘’; // Add nothing
continueExperiment = false; // End experiment

Thank you!!

Look at this to create conditional loops:

Here is the part of my code with keyboard responses:

> if ((key_resp.keys === "m")) {
>     AgreeSelected = 1;
>     DisagreeSelected = 0;
> } else {
>     if ((key_resp.keys === "p")) {
>         AgreeSelected = 0;
>         DisagreeSelected = 1;
>     }
> }

If you have access to questionnaire software like Qualtrics that allows a custom URL at the end, I would recommend that for participant information and demographics. You can also assign to condition using the modulus of a participant number created from my new web app.

Best wishes,


1 Like

I have a consent form at the beginning with components like “press ‘y’ if you agree and want to start / press ‘n’ if you disagree and want to quit”. However, I am unable to find a proper JS code for terminating/ quitting the experiment when ‘n’ is pressed. The experiment jumps to the next routine no matter what.
Could you please help?

I did my consent form as a text component and gave the options "Press ‘y’ if you agree with the terms and want to proceed/ Press ‘esc’ if you don’t agree with the terms and want to end the experiment. This maybe an easier solution @Surabhi_Lodha.
I have a 3 questions questionnaire, that I adapted to have yes/no answers. I put again as text input and timed them in the routine:

And I set the keyboard input to NOT force the Routine to end:

But If you have more questions than that, you could create a loop and put your questions in your .xlsx file…

Hi @Nathacia_Lucena,

Thank you for this solution. However, the ‘esc’ key only stops the experiment from moving further but does no give a clean exit, like closing the experiment window altogether. Is there a way/ code to do that?

Also, I can’t comprehend what the last 3 components (assessans, starting, startingk) in your assessment routine are? Please explain.

In my experiment ‘esc’ exits it. It doesn’t go to The thanking page, but it ends the experiment and the parcial data is generated. I didn’t look for any other way as this is enough for me. Sorry :frowning:

The other components is because I created a layout. In the top, it reads “Before we start, we need some more information:” (AssessPres); in the bottom it reads “Press ‘y’ for YES and press ‘n’ for NO” (Assessans). These are constant while I have the 3 questions to appear in the screen in different times. As I put the answer to the questions to not terminate the routine, I created a message that reads: “Thank you for answering :slight_smile: Press SPACE to start” (Starting) that appears after the three questions of the assessment. The Startingk component is the key component that end the Routine.


I am not sure how to use this web app for assigning IDs?
And also the one which alternates allocation,

Is it necessary to have the survey made in Qualtrics for these to work?

It is specifically designed for people who don’t have Qualtrics.