Pavlovia survey issue with group allocation using a random number

Hi everyone,

I’ve tried to implement a simple survey where a random number is generated, which is then used to assign participants to one of two groups. Participants then see different pages depending on the group they’ve been assigned. This is the survey: Pavlovia Survey

The issue is that, while it works fine when no answers are submitted, when I type in answers it starts going back and forth between the pages/reassigning participants to another group.
For example: participant is assigned to group A, sees the page for group A, types in an answer, clicks Next. The survey goes back to the random number/group allocation page, sometimes assigns group B instead, participant sees the page for group B.

I’m not sure if that’s entirely clear, so I’ve taken a screen capture of what is happening, which is in the folder attached. In the folder are also the survey’s JSON file and a data file, where you can see on line 3 that I’ve been able to answer question1 (on the group A page) and question2 (on the group B page), which is because of what I’ve explained.
survey-group-issue.zip (3.0 MB)

I’ve looked at all my settings and can’t see anything that would cause this, so not sure if this is my fault or if there’s a bug maybe?

Thanks in advance for your help!
Lorna

Sorry, but I’m afraid this is a bug. I’m hoping it will be fixed over the next month or so.

https://run.pavlovia.org/pavlovia/survey/?surveyId=0a1c0544-25d1-476d-b735-e1f074b3e387

Good to know, thanks Wake!

I’m helping about 115 students with final year projects and they have started to get to the point where this bug manifests - it does seem to have appeared since the Autumn as I demoed using the method back in October. Hate to be putting the pressure on but any sense of that ‘month’ estimate to fix it given 27 days ago means it may well get fixed in the next week (which basically would save us a huge amount of grief) or is it further out in which case I need to dfind a workaround

Hi Andrew,

Honestly I’m not sure whether it will be fixed by next week.

However, I’ve just written a workaround

https://run.pavlovia.org/vespr/survey-group

To launch a survey create a URL of the form

https://run.pavlovia.org/vespr/survey-group?surveyID=733492ba-8997-416b-9c8c-4fe08c3519bc&groups=3

This will launch survey 733492ba-8997-416b-9c8c-4fe08c3519bc and randomly allocate a value for group between 1 and 3.

Please test.

Hi Wake, I’m afraid when I click on https://run.pavlovia.org/Wake/survey-group I’m getting a 404 not found page

Sorry, wrong link. I moved it to https://run.pavlovia.org/vespr/survey-group/

Thanks that appears to be working with quick test at survey-group [PsychoPy]

Note for anyone else you then use Display page logic like {group} = ‘1’

I presume however this method will not pass Sona credit data to the survey - any chance of a variant that would do so?

What variable do you need to pass? It already passes participant.

Unless I’m misunderstanding the completion URL Sona is also expecting experiment_id and credit_token

The completion URL on the overview page should look something like this:
'https://ucd-ie.sona-systems.com/webstudy_credit.aspx?experiment_id=453&credit_token=249cfe8d848b4e1bb0099f8386be61bc&survey_code=' + {participant}

Since experiment_id and credit_token don’t change for a given experiment then these can be hard coded in the overview page (as per your link). Is that working?

Ah thanks, I wasn’t thinking that through fully but yes that should work for them

Hi everyone,

Trying to go with random allocation of participants to groups and I have followed Wake’s workaround (thank you as always, Wake) but I can’t seem to get the pages to display according to that logic. I have put {group} = ‘1’ etc., in the logic for each page but it still shows all the pages. I can tell from the URL that it is changing the group number. Have I missed a stage?
Thanks!

Please could you show an example of a URL? You can replace some of the survey code with xxx if you want to keep it private.

I also might need to update my code to cope with 2024 survey URLs.

2 posts were split to a new topic: Random allocation to Condition 1 or Condition 2 in Pavlovia

Hi, this is the link I am using : survey-group [PsychoPy]. Thank you!

The URL you are using is correct. The missing step is that in the survey you need a hidden expression question to copy the value for group. I’ve just been testing with:

https://run.pavlovia.org/vespr/survey-group/?surveyId=733492ba-8997-416b-9c8c-4fe08c3519bc&groups=3

It fails if I remove this question:

N.B. Invisible expression questions fail unless “Clear the value if the question becomes hidden” is set to None

Yep - I have it to evaluate that now and return the group number on the first page so that variable must be set but then it does not display any of the options. This is what I have done on each page:

Try adding a final page that everyone sees. I think that there may be an issue with not being able to dynamically turn a Complete button into a Next button.

I am currently assuming that you only have one block. The survey-group code sends to the 2024.1.0 URL which only works with single blocks.

Yes, only one block. I tried that and it just skipped all the questions. I often find I am doing something silly but I am going to use this as a template for students and staff so I need to get it right! I attach the json in case that helps
survey_87fff09f-8f5b-43ac-9495-0d6f06b4bd78.json (1.6 KB)