Query strings: Sending embedded Qualtrics field values to Pavlovia

URL of experiment: https://pavlovia.org/mdlathouwers/g_001

Description of the problem: I am unable to pass Qualtrics embedded data (in this case, a randomly generated participant ID) from Qualtrics to Pavlovia. I am able to pass hard coded information, but this does not result in a unique identifier for each participant.

The “Recruiting participants and connecting with online services” page shows how to pass data using query strings, but it only demonstrates hard coded values, e.g:
https://run.pavlovia.org/yourUsername/yourStudyName/index.html?participant=10101010

The “Recruiting with Prolific” page shows how to pass data in query strings from Prolific to Pavlovia, and I have been trying to model off this, but without success. Whatever I place at the end of the query string (after the ‘?participant=’) is simply passed in as the hard value.
When I try this: https://run.pavlovia.org/mdlathouwers/g_001/html/?participant={%RNDID%}, I end up with csv filenames that start with ‘{{RNDID}}_G_001_2020-05-22…’ etc.

I feel like I am close, but can someone clarify the correct way to use query strings to pass embedded data from Qualtrics to Pavlovia?

Any assistance would be greatly appreciated.
Mark Lathouwers

Hi Mark,

Here is what I’m using:

https://run.pavlovia.org/Wake/ebbinghaus-darts/html/?order={e://Field/order}&researcher={e://Field/researcher}&participant={qo://QO_b7pqFlMnRyctNcr/QuotaCount}&id={e://Field/id}

Researcher is set as the PI’s ID so that I can effectively password protect the experiment and send people who haven’t read the PI sheet back to Qualtrics

I attempted to use a quota to pass a unique ID number. However, I’ve discovered that I’ve ended up with duplicate entries, presumably due to overlapping Qualtrics sessions.

I’ve therefore just added a randomly generated ID as well. In the survey flow I have
researcher = xxxx
participant = {qo://QO_b7pqFlMnRyctNcr/QuotaCount} id = {rand://int/1:1000}

I’m also using Qualtrics to randomly assign to conditions, so in this case I also have an evenly presented randomiser setting order as either 1 or 2.

Best wishes,

Wakefield

Hello Wakefield,
thank you for your quick reply and your clear example.

I was able to successfully embed the ID field, but this generated a new error at the end of the experiment.
I count this as progress! :slight_smile:

When the experiment is complete, the following error occurs when Pavlovia tries to to save the results:

Unfortunately we encountered the following error:

  • when uploading participant’s results for experiment: mdlathouwers/g_001
  • when saving data from a previously opened session on the server
  • unable to save data to file: [Errno 2] No such file or directory: ‘/var/www/pavlovia.org/run/mdlathouwers/g_001/data//{e://Field/RNDID}_G_001_2020-05-24_10h10.21.579.csv’

Try to run the experiment again. If the error persists, contact the experiment designer.

It looks like one of the query string slashes is telling Psychopy to save to a folder (maybe /RNDID?) below the /data folder, but that /RNDID folder doesn’t exist.

Do you remember seeing anything like this when you first started setting up your query strings?

All the best,
Mark

PS - I like your method of password protection using the PI ID, that will be useful!

PsychoPy shouldn’t be seeing your Qualtrics code. What is the text of your URL in Survey Options / Redirect to a full URL ?

Here are some screen shots of my method:

  1. Add embedded data in the survey flow

  2. Check the appropriate code for an embedded variable


    qualtrics_pipedtext2

  3. Add that text to the end of the URL

When you leave Qualtrics you should arrive at Pavlovia with id=x (or in your case participant) where x is a number between 1 and 1000, not id=${e://Field/id}

2 Likes

Hello Wakefield,
Thank you for your screen shots, they clearly showed me where I was going wrong, and this problem is now solved!

I was omitting the $ in the Qualtrics url, hence Pavlovia was receiving the field description and not the field value. One keystroke later, it is working as it should be; the ppt id is being sent, and the results are saved in Pavlovia.

Thank you so very much for your help and advice!

All the best,
Mark