langcog / web-cdi

7 stars 5 forks source link

LookIt link support #374

Closed mcfrank closed 1 year ago

mcfrank commented 2 years ago

Hi @HenryMehta, we are looking to build a new feature for a collaborator study (the study is called RISE).

The goal is to accept URLs from a new external site called LookIt. We would like to create a url for lookit, like our previous RedCap link. This URL will accept two fields, called child and response, but we will squash these together to make our source_id under the hood. So instead of http://webcdi.stanford.edu/interface/langcoglab/RedCap%20Sample/new_parent/?source_id={{%source_id%}} we would like http://webcdi.stanford.edu/interface/langcoglab/RedCap%20Sample/new_parent/?child={{%child%}}&response={{%response%}} but then source_id is just child and response, joined with a _ or something. (An email from @mekline with further details on the URL format is below).

The timeline for this is probably the next two weeks, does that seem OK to you?

thanks in advance!

Great - our query strings currently look like this: https://some.url/account/restofurl?child=3QAUS7&response=9aaeb-4422-8aa1-e0fb400ef65b4-fdae8d

One note is that for security reasons, this uses the short child_id, which is unique within an experiment but differs across, to prevent unplanned data linking. You can download the globally unique ID/hashed keys from Lookit, it's just an extra step in data cleaning to be aware of. 

Caregivers grant permission to access their account data (which includes some demographic info) by clicking the button to these links, so in theory we could also send additional pieces of information - we'd probably want to evaluate on a case by case basis, but you can see all of the available fields by going to your own account page in Lookit (e.g. [here](https://lookit.mit.edu/account/demographics/)).
mcfrank commented 2 years ago

One minor note is that, unlike for prolific and other sources, participants may not know their source_id in this case, so we might not want participants to be able to change it in the demographics part of the form...

HenryMehta commented 2 years ago

@mcfrank

Can I just check, are you asking the we accept the URL http://webcdi.stanford.edu/interface/langcoglab/RedCap%20Sample/new_parent/?child={{%child%}}&response={{%response%}} and in the code I combine child and response into source_id so `sourceid = child + '' + response?

And then if Lookit is the selected Participant Source then we do not show the source_id to the user?

Also, on completion of the survey, should the user be redirected somewhere and if so, how is this link made?

mcfrank commented 2 years ago

Yes that's exactly right.

with respect to redirect, I am not sure. let's tag @mekline and see what she thinks.

HenryMehta commented 2 years ago

@mcfrank

I amended code so that if child and response are in the url GET data then they are combined and stored in source_id.

I have added a boolean question to the study 'Hide source id from parent/participant'. When selected the source_id is not shown to parents. This way you can use it with different companies.

I am deploying to development now so you can test and confirm working as you would expect before I deploy to production

mcfrank commented 2 years ago

thanks Henry! @JMankewitz can you test in concert with @mekline? thanks!

mekline commented 2 years ago

@JMankewitz The best way to do this would be to make a new study in the Sandbox lab (which all researchers have access to), with a setup as close as possible to your actual scenario (so e.g. making a short internal experiment with link at the end, OR an external study going straight to the webCDI, whichever matches your plans). Let me know if you need more orientation either by email or want to set up a quick call!

JMankewitz commented 2 years ago

Hi @mekline! I'm having trouble adding an exit URL with parameters. Is this something I'd add during the study setup/editing page (e.g., in the Exit URL), or something I add to the protocol configuration? Are the child IDs and response IDs exposed at some point (I'm not seeing them as variables) so they can be piped into the experiment itself?

It might be worth touching base with a short call! I can followup over email with my availability if needed. Thanks!