0 votes
in SoSci Survey (English) by s139639 (360 points)

I am tring to find another way (rather than directly asking people for their worker IDs). Do you have any code that could enable that? I saw that it was done automatically in Qualtrics, but I'm wondering if it's the case for SosciSurvey. Thank you in advance!

2 Answers

0 votes
by SoSci Survey (301k points)
edited by SoSci Survey

The most recent information from the Amazon API documentation was that the worker ID is not published automatically. The official information from Amazon is:

To verify that Workers actually complete your survey, require each Worker to enter a unique survey completion code to your HIT. Consult with your survey service provider on how to generate this code at the end of your survey.
(https://requester.mturk.com/create/projects/new)

This is also what Qualtrics explains on their website:
https://www.qualtrics.com/support/survey-platform/common-use-cases-rc/assigning-randomized-ids-to-respondents/

And there are also instructions on the Internet that say that you need to ask for the WorkerID in Qualtrics as well: https://jessicaeblack.org/research/tips-on-using-mturk-with-qualtrics/

We will evaluate the options to circumvent this necessity by using the MTurk developer options. Should you have any different information (about MTurk or Qualtrics), please let us know.

Update: Here is the manual how to work with MTurk in SoSci Survey: Amazon MTurk

by s139639 (360 points)
Hello, thank you very much for your reply. Sorry for insisting on this matter, but It is important because I want to be sure of everything before I start collecting a large-scale data. I think It is possible to capture the workers ID by reprogramming a code in Amazon Turk, however I would need to insert an "embedded data" variable in soscisurvey. So, should I create an internal variable to do so? I am not sure which variable in sosci survey can capture the worker ID in this case? Do you have a code that would help me do that? So sorry for the inconveniece! Thank you very much in advance!
by SoSci Survey (301k points)
> I think It is possible to capture the workers ID by reprogramming a code in Amazon Turk

If you have any information on this, please let me know. I did not find something about that so far.

> however I would need to insert an "embedded data" variable in soscisurvey. So, should I create an internal variable to do so?

Depends on "embedded data" means specifically. Please send me more specifications about the context.

> I am not sure which variable in sosci survey can capture the worker ID in this case?

You can story anything in an internval variable. The question is how the information comes from Amazon MTurk to SoSci Survey.

And this is where I need the information that you say you have, but I do not yet have.

You are very welcome to insist on this matter. I gladly provide a more convenient solution for Amazon MTurk, but as I wrote ... I do not yet have any information that allows me creating a solution. So please feel free to send me the information that you have!
by s139639 (360 points)
Hello, thank you very much for your reply. These are the steps we follow in Qualtrics (should apply to sosci survey as well). First, follow these steps in Qualtrics:  
1.    Survey flow
2.     Add a new element here
3.    Embedded data
4.    In the box, delete the text that reads, “Create New Field or Choose From Dropdown...,” and type MID (case sensitive).


Next, in MTurk, follow these steps when setting-up the HIT:
1.    Design layout
2.    Source
3.    Replace text with script below (make sure to replace the text https://YOUR_QUALTRICS_SURVEY_URL_GOES_HERE with your survey URL)
4.    Source
5.    Finish setting-up HIT

And this is a part of MTURK code we have modified.

<table>
 <tbody>
 <tr>
 <td><strong>Survey link:</strong></td>
 <td><div id="myelementLink" style="display: inline; font-family: Verdana;"><tt>URL not shown because there is an error with Javascript on your computer. To perform this HIT, you must have Javascript and cookies enabled on your browser.</tt></div>
<script type="text/javascript" language="JavaScript"><!--
var assignment_id_field = document.getElementById('myelementLink');
var paramstr = window.location.search.substring(1);
var parampairs = paramstr.split("&");
var mturkworkerID = "";
for (i in parampairs) {
 var pair = parampairs[i].split("=");
 if (pair[0] == "workerId")
 mturkworkerID = pair[1];
}
if (mturkworkerID == "" ) {
 assignment_id_field.innerHTML = '<tt>The link will appear here only if you accept this HIT.</tt>';
} else {
 assignment_id_field.innerHTML = '<a target="_blank" href=" https://YOUR_QUALTRICS_SURVEY_URL_GOES_HERE 7”?MID=' + mturkworkerID + '"><h1><span style="color: rgb(255, 0, 0);"><span style="font-family: Courier New;"><b>Click here to begin taking the survey!</b></span></span></h1></a>';
}

The problem is that I do not know how to create this embedded data in sosci survey
by SoSci Survey (301k points)
Okay, looks fair enough :)

To read the "MID" parameter that is inserted by your MTurk HTML modification, please create a question of type "Device and Request Variables".

In that question go to the tab "Variables (POST/GET)" and enter "MID" into the field for "Variable name (1)". Save the question, and drag it on the first page of your questionnaire.
by SoSci Survey (301k points)
PS: If that works, would you a allow me to add the MTurk code from above to the SoSci Survey manual? I think it could help lots of people :)
by s139639 (360 points)
Thanks a lot for your reply! Yes, of course! I will let you know if that work, and will send you the complete code if necessary.
by s139639 (360 points)
Hello. I have tried that, but unfortunately, it didn't work. I couldn't capture the worker IDs on the final dataset. Do you think that it is related to how we programmed the "MID" variable in sosci survey? In the final dataset, the variable name is not even shown (it was skipped).
by SoSci Survey (301k points)
You can try and start the survey with a variable MID added in the URL, e.g.

https://www.soscisurvey.de/mySurvey/?MID=123

If the variable is stored in that case but not when you start via MTurk, then your code on MTurk is not working. If the variable is not stored, then double-check if you have dragges the "device..." question on the first page of the questionnaire.
by s139639 (360 points)
So, this is an example of an external question data structure (as provided by Amazon Turk). Do you have an idea how I can do that using sosci survey? I am sorry for my lack of knowledge in programming.

<?xml version="1.0" encoding="UTF-8"?>
<ExternalQuestion xmlns="[the ExternalQuestion schema URL]">
  <ExternalURL>https://tictactoe.amazon.com/gamesurvey.cgi?gameid=01523</ExternalURL>
  <FrameHeight>0</FrameHeight>
</ExternalQuestion>
by SoSci Survey (301k points)
Yes, I know this example ... it does definitly not contain any MTurk Worker ID.
0 votes
by s139639 (360 points)

Hello, please find attached below some screenshots from the Amazon Turk blog, another solution is provided, but I am not sure how to do this on sosci survey (create an external question, and attach the worker ID on the URL of the survey). Actually, I have tried to do this with the "r" and "q" parameters, but nothing was displayed in the dataset neither.

this is the link: https://docs.aws.amazon.com/AWSMechTurk/latest/AWSMturkAPI/ApiReference_ExternalQuestionArticle.html

by s139639 (360 points)
edited by s139639
Hello. Thank you for providing the link! The code finally worked! Thanks a lot!
by SoSci Survey (301k points)
When you have the preview in MTurk, what exactly is displayed where the link should appear? Did you include the "device..." question on the first questionnaire page? Is anything stored in the REF variable?
by s139639 (360 points)
Sorry, it actually worked. The mistake I did is that I didn't modify this line : <section class="container" id="SurveyLink">\\

Once I did it, it worked fine! Thank you!
by s139639 (360 points)
Sorry to ask another question (just for my understanding), but I would like to understand the two modifications (scripts) you brought to the code. Is that possible? Thank you in advance! :)
by SoSci Survey (301k points)
You can download the full JavaScript by just opening the script URL in your browser (the first modification). What the script does is: It checks if there is a assignmentId und workerId in the URL on the respondent. And if there is, it copies the query that it "sees" on MTurk and attaches it to the link that will then be written into the form.

By and large the same that your script example from above does, but I thinks it's a bit more convenient.

Willkommen im Online-Support von SoSci Survey.

Hier bekommen Sie schnelle und fundierte Antworten von anderen Projektleitern und direkt von SoSci Survey.

→ Eine Frage stellen


Welcome to the SoSci Survey online support.

Simply ask a question to quickly get answers from other professionals, and directly from SoSci Survey.

→ Ask a Question

...