# Limit the number of participants on Pavlovia

**URL:** <https://discourse.psychopy.org/t/limit-the-number-of-participants-on-pavlovia/20624>\
**Category:** Online experiments\
**Created:** [February 19, 2021, 5:42pm UTC](https://discourse.psychopy.org/t/limit-the-number-of-participants-on-pavlovia/20624 "2021-02-19T17:42:21Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alessandro\_Guida](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/alessandro_guida/32/6650_2.png) [@Alessandro\_Guida](https://discourse.psychopy.org/u/Alessandro_Guida)\
**Post date:** [February 19, 2021, 5:42pm UTC](https://discourse.psychopy.org/t/limit-the-number-of-participants-on-pavlovia/20624/1 "2021-02-19T17:42:21Z")

</div>

URL of experiment: [https://run.pavlovia.org/AlessandroG/dfsdfdfdffsd](https://run.pavlovia.org/AlessandroG/dfsdfdfdffsd)

Description of the problem:  
Hi there!  
I have a full license.  
As indicated in the topic I would like to know if there is a way to limit the number of participants that execute the experiment through a link.  
For example imagine I just need 4 participants, I don’t want more, is there a way for the link or for the experiment to go dead after 4 participants.  
Best,  
Alessandro

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [February 21, 2021, 4:12pm UTC](https://discourse.psychopy.org/t/limit-the-number-of-participants-on-pavlovia/20624/2 "2021-02-21T16:12:56Z")

</div>

You could use my VESPR Pavlovia link to assign a consecutive participant number and then halt the experiment if the number is too high.

However, this doesn’t currently check whether the participant finished. On day I expect someone will commission me to create a new web app which reuses incomplete participant numbers

---

<div class="post-metadata">

**Author:** ![Alessandro\_Guida](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/alessandro_guida/32/6650_2.png) [@Alessandro\_Guida](https://discourse.psychopy.org/u/Alessandro_Guida)\
**Post date:** [February 21, 2021, 4:22pm UTC](https://discourse.psychopy.org/t/limit-the-number-of-participants-on-pavlovia/20624/3 "2021-02-21T16:22:28Z")

</div>

HI,  
Thanks, can you explain to me how it works, I don’t have great coding skills

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [February 21, 2021, 4:47pm UTC](https://discourse.psychopy.org/t/limit-the-number-of-participants-on-pavlovia/20624/4 "2021-02-21T16:47:01Z")

</div>

Please start by looking at the instructions for my web app.

[https://moryscarter.com/vespr/pavlovia.php](https://moryscarter.com/vespr/pavlovia.php)

---

<div class="post-metadata">

**Author:** ![Alessandro\_Guida](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/alessandro_guida/32/6650_2.png) [@Alessandro\_Guida](https://discourse.psychopy.org/u/Alessandro_Guida)\
**Post date:** [February 21, 2021, 5:14pm UTC](https://discourse.psychopy.org/t/limit-the-number-of-participants-on-pavlovia/20624/5 "2021-02-21T17:14:38Z")

</div>

Thanks, I get a 404 not found error. As suggested I added a / but I still get the error.

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [February 21, 2021, 5:35pm UTC](https://discourse.psychopy.org/t/limit-the-number-of-participants-on-pavlovia/20624/6 "2021-02-21T17:35:18Z")

</div>

Is your study active? If so, please could you post the link you’re testing?

---

<div class="post-metadata">

**Author:** ![Alessandro\_Guida](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/alessandro_guida/32/6650_2.png) [@Alessandro\_Guida](https://discourse.psychopy.org/u/Alessandro_Guida)\
**Post date:** [February 21, 2021, 5:49pm UTC](https://discourse.psychopy.org/t/limit-the-number-of-participants-on-pavlovia/20624/7 "2021-02-21T17:49:32Z")

</div>

Yeah this is study  
[https://run.pavlovia.org/AlessandroG/gggggggg/html/](https://run.pavlovia.org/AlessandroG/gggggggg/html/)  
By the way, I managed, the link with vespr works if I just limi to a and b like this:  
[https://moryscarter.com/vespr/pavlovia.php?folder=AlessandroG&experiment=gggggggg](https://moryscarter.com/vespr/pavlovia.php?folder=AlessandroG&experiment=gggggggg)  
But how do I get “participant” and “session” integrated?  
And of course the big question, how to I limit the number of participant in terms of code?

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [February 21, 2021, 6:15pm UTC](https://discourse.psychopy.org/t/limit-the-number-of-participants-on-pavlovia/20624/8 "2021-02-21T18:15:31Z")

</div>

When you click on [https://moryscarter.com/vespr/pavlovia.php?folder=AlessandroG&experiment=gggggggg](https://moryscarter.com/vespr/pavlovia.php?folder=AlessandroG&experiment=gggggggg) a value for participant is assigned, e.g. [Pg1FrEssaixxxxx [PsychoPy]](https://run.pavlovia.org/AlessandroG/gggggggg/html/?participant=9&id=&session=&researcher=)

You can add id, session and/or researcher to the first link to have them pass through unchanged.

You could have a routine with an unending text component in your experiment with a code component which says (in Begin Routine)

```auto
if int(expInfo['participant'])<4:
     continueRoutine=False

```

where 4 is four more than the value of participant when you last test the link.

---

<div class="post-metadata">

**Author:** ![Alessandro\_Guida](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/alessandro_guida/32/6650_2.png) [@Alessandro\_Guida](https://discourse.psychopy.org/u/Alessandro_Guida)\
**Post date:** [February 21, 2021, 6:28pm UTC](https://discourse.psychopy.org/t/limit-the-number-of-participants-on-pavlovia/20624/9 "2021-02-21T18:28:34Z")

</div>

Thank you very much for all this!  
I will try out but I have two questions

1. Why when I go through the vespr link (just below), it does not ask me anymore for the session number (because in the future, I would like the participants to add some stuff, age, name etc…)?  
[https://moryscarter.com/vespr/pavlovia.php?folder=AlessandroG&experiment=gggggggg](https://moryscarter.com/vespr/pavlovia.php?folder=AlessandroG&experiment=gggggggg)
2. If I add a Routine in Psychopy, chances are that it will not work on Pavlovia, don’t you think?

Thanks again!

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [February 21, 2021, 6:38pm UTC](https://discourse.psychopy.org/t/limit-the-number-of-participants-on-pavlovia/20624/10 "2021-02-21T18:38:53Z")

</div>

1. Anything apart from the list of variables can be used for participant input.

2. Have you seen my crib sheet? My new specialism is writing PsychoPy experiments that also work online.

---

<div class="post-metadata">

**Author:** ![Alessandro\_Guida](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/alessandro_guida/32/6650_2.png) [@Alessandro\_Guida](https://discourse.psychopy.org/u/Alessandro_Guida)\
**Post date:** [February 21, 2021, 6:43pm UTC](https://discourse.psychopy.org/t/limit-the-number-of-participants-on-pavlovia/20624/11 "2021-02-21T18:43:47Z")

</div>

Thanks again for your time

Concerning the first point, the problem is that when I use your link, Pavlovia does not ask for the session number anymore. Just compare what happens for both links:  
[https://run.pavlovia.org/AlessandroG/gggggggg/html/](https://run.pavlovia.org/AlessandroG/gggggggg/html/)  
[https://moryscarter.com/vespr/pavlovia.php?folder=AlessandroG&experiment=gggggggg](https://moryscarter.com/vespr/pavlovia.php?folder=AlessandroG&experiment=gggggggg)

Concerning the second point, no I was not aware of, I will try to use your routine and see if it still works on Pavlovia!

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [February 21, 2021, 6:56pm UTC](https://discourse.psychopy.org/t/limit-the-number-of-participants-on-pavlovia/20624/12 "2021-02-21T18:56:43Z")

</div>

Anything apart from the list of variables I gave you in my earlier post (which includes session) can be used
