Combining qualtrics with psychopy

Apologies if this has already been addressed but I can’t seem to find any guidance.

My experiment runs in 3 parts:
1 - initial qualtrics questionnaire
2 - main psychopy study
3 - second qualtrics questionnaire

I’ve looped the 3 together but I wondered if there’s a simple way of connecting each aspect on a participant by participant basis?


1 Like

Tricky. You can’t completely incorporate them with each other, unfortunately. You could possibly try using links with query strings, which definitely works with Qualtrics:

However, I don’t know if you could access a query string in PsychoPy. Basically the end of the first questionnaire would need to link to the PsychoPy study on Pavlovia, and that link would include some information in its query string. It may be possible to read off the query string using a JS code component and URLSearchParams

I’m also not entirely sure about how to get them to finish the study on Pavlovia and give them a link with a query string to the final Qualtrics survey, but I think if there’s any reasonable way to do this, this is how it’ll work.

You access a query string in PsychoPy using the expInfo dialogue box. There’s some stuff about how to do this in my crib sheet (pinned post).

Thank you both.
Just to clarify - I’ve already connected the 3 parts together, but what I don’t know what to do yet is match each qualtrics response with the correct csv file in pavlovia.

What have you tried?

You can save the ResponseID to an embedded variable in Qualtrics and then pass that as the participant id to Pavlovia

Hello @jemmasedgmond
I am trying to link qualtrics to psychophy study and then link it back to qualtrics. So, it sounds like what you did. But, I couldn’t figure out how to do this. Could you please tell me how you did it? By the way, I will be recruiting participants in MTurk.

Hi @meltem

So on prolific (but it should be the same for MTurk) I link directly to the qualtrics study. Then on your qualtrics survey, select survey options then survey termination and you can put your pavlovia link in the “redirect to a URL” option.
Then finally, when you have your study open in psychopy, select experiment settings, the “online tab” then paste your final qualtrics study in the “completed URL” option.

1 Like

Thank you so much @jemmasedgmond
I was also wondering if you were able to match qualtrics and pavlovia responses with the correct participant number? (I believe this was your earlier question). So, for example, if there is data associated with the participant number 101 (or Mturk ID) in qualtrics (first phase), then when we move to pavlovia (second phase) and then back to qualtrics (third phase), do the data associate to the correct row of the participant? I worry whether it is possible to match subjects across platforms when we link qualtrics and pavlovia. Was this an issue for you, and do you know how to solve this? Sorry for my long message. Many thanks in advance.

I did find a way - it’s not the most elegant and it’s a bit time-consuming but I didn’t have time to figure another way out.
I basically just make sure participants IDs are recorded in both qualtrics questionnaires and in the main study. I then match them up.
It’s not ideal because there’s no way to force participants to record their ID during the main exp (or at least I’ve not figured out a way to do it), so there have been a number of participants I’ve not been able to match up.

There has to be a simpler way of doing this so it may be worth asking around if you have the time (and please do let me know if you find a better way!)

Have you looked at Linking participant ID from qualtrics ?

Thanks for your suggestions.
@wakecarter, you said this “In Qualtrics you can set the ResponseID in the Survey Flow as embedded data. You could then pass this to Pavlovia using ?participant={e://Field/ResponseID}" I am new to Pavlovia and Psychopy. I am trying to make my own Stroop task in Psychopy by editing a demo using the Builder. I am not sure how exactly I add this "participant={e://Field/ResponseID}” to Pavlovia. Do I click “view” and then click “open code runner” and add this to the code? Then, Psychopy records response ID automatically which should be the same as qualtrics for each participant?

You don’t need to do anything within Pavlovia apart from not delete or change “participant” from your expInfo dialogue box.

The key is to add the variable to the link you use in Qualtrics to call Pavlovia.

participant={e://Field/ResponseID} is Qualtrics code

@wakecarter Many thanks for your response. I am wondering about one more thing. Your suggestion will help me to save response id and pass it to Pavlovia. So, I can match the data between Qualtrics Part 1 and Pavlovia. However, I also have part 2 in Qualtrics. So, I will redirect participants from Pavlovia to Qualtrics again. And, because this is a separate Qualtrics survey (part 2), I believe it will have a different response id than the first Qualtrics one. Is it possible to pass response ID again (from Pavlovia to Qualtrics? I am wondering how I can match this third part with others. I looked at your crib sheet but couldn’t understand how to do this. I would appreciate if you could let me know. What would be the best way to match all 3 parts? :neutral_face:
Thank you!
All the best,

Send the Qualtrics ResponseID from Pavlovia to the second Qualtrics survey as an embedded variable (called participant for example) using $“"+expName+"&participant=”+expInfo[‘participant’]. as per my crib sheet.

Remember to set participant in the survey flow of the second survey as from panel or URL.

Thank you! @wakecarter
With this “Remember to set participant in the survey flow of the second survey as from panel or URL”, do you mean I set an embedded variable named participant = Response ID in second Qualtrics survey?

No, just declare an embedded variable called participant

I’m on my phone so can’t easily log into Qualtrics to screenshot what setting an embedded variable looks like in the survey flow

Hello @wakecarter,

I have a questionnaire on Qualtrics that contains blocks with links to Pavlovia experiments. I have been having trouble redirecting participants back to exactly where they left off on the Qualtrics questionnaire after finishing each task. This is the link I pasted into Pavlovia to redirect back to Qualtrics:
$“” + expInfo[‘participant’]

However, it redirects back to the beginning of the questionnaire instead of saving their progress. I have these values as embedded data in Qualtrics survey flow: “id”, “interestingpoints=1”, and “participant”.

I would appreciate really your help on this matter!

I’ve not yet succeeded in having a single Qualtrics data file for a participant before and after Pavlovia. However, I have managed to use the same Qualtrics survey by using branches in the survey flow which depend on the value of embedded data from Pavlovia. This gives multiple rows per participant but in my case I was only interested in the post-Pavlovia row since the pre one didn’t contain any questions.

1 Like

Hi @wakecarter
Thank you for your help earlier. I tried what you suggested. I was successful to link all three (qualtrics, pavlovia, back to qualtrics) and match participant ID between qualtrics part 1 and pavlovia.
But, your suggestion about matching pavlovia and qualtrics part 2 did not fully work for me.
As you suggested, I wrote this in completedURL in the experiment settings:
$“” + expInfo[‘participant’]
And, I also created an embedded variable in the survey flow named participant (in the second qualtrics survey).
When I take the study, I have the participant column but it is empty. So, the participant information (which is essentially the response ID from the qualtrics part 1) is not carried to part 2. Do you have any idea what I am doing wrong? Thank you…
All the best,

You need ?participant= not just participant

Best wishes,