+1 vote
in SoSci Survey (English) by s080681 (125 points)

Hello,
I am happy to use Soscsurvey. But I would like to use Amazon's mturk to recruit participants and don't know how to generate the unique completion code.

Mturk offer this option called "survey link", where people get the link to the survey and see a box where they need to enter a code to prove they have finished it and get paid. The code should be provided to them at the end of the soscisurvey questionnaire.
Is there a easy way to do this?
The codes are pre-generated and unique. What I need to do now is to present each participant with one of them after they finish all the questions.

Any suggestions how to do this?

Thank you in advance!

1 Answer

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

I'd recommend the random generator for this task. Fill in all the codes as content, and draw one code per interview. You should also check how often the random generator has been completes so far (that's an additional variable "...CP" in the data set for the random generator) to ensure that at least one new code was available.

To display the code, just use a placeholder. Here's a sample code if your random generator has the ID "RG01" and you use a placeholder %code% in your questionnaire (e.g. a text element):

question('RG01');  // You may as well drag the RG01 into the page (above)

// Stop right now, if no more codes are available
if (value('RG01_CP') > 0) {
  text('quotafull');
  buttonHide();
  pageStop();
}

// EITHER Prepare placeholder %code%
// and use this placeholder in some text element below the PHP code
replace('%code%', 'RG01', 'response');

// OR display the code immediately
html('<p>Your code is <strong>'.value('RG01', 'label').'</strong>.</p>');
by SoSci Survey (328k points)
Solved by now? Your other question in the online supports says that it works :)
https://support.soscisurvey.de/?qa=12622/i-want-to-generate-the-unique-codes-for-mturk&show=12642#c12642
by s131273 (100 points)
Hello!

I am having the same issues as described above. So far, I have created the random generator question (labeled RG01 for the sake of consistency with this thread) and have inserted it in my questionnaire. Beneath RQ01 I have created a PHP box with the PHP code described above. However, for both options (placeholder option with %code% embedded in a text element below the PHP code element, and display code immediately option), the randomly generated code is not visible on the page of the survey.

I know that a random code number for RG01 is successfully being generated each time I test it (so that part is working successfully), but the code number itself is not visible for participants completing the survey.

The PHP code I have been trying to use, copied from the example above, is:

// Stop right now, if no more codes are available
if (value('RG01_CP') > 0) {
  text('quotafull');
  buttonHide();
  pageStop();
}

// Prepare placeholder %code%
// and use this placeholder in some text element below the PHP code
replace('%code%', 'RG01', 'response');

html('<p>YOUR UNIQUE SURVEY COMPLETION CODE FOR MTURK IS <strong>'.value('RG01', 'label').'</strong>.</p>');



The text element below this PHP code, on the same page of the survey, is:

Thank you for your participation in this study! YOUR UNIQUE SURVEY COMPLETION CODE FOR MTURK IS %code%



From this PHP code, the text visible to participants on the actual survey page is:

YOUR UNIQUE SURVEY COMPLETION CODE FOR MTURK IS .

Thank you for your participation in this study!

YOUR UNIQUE SURVEY COMPLETION CODE FOR MTURK IS


I have been trying to figure out a solution to make this work for several hours, and I appreciate your help with solving this issue!
Thanks!
by SoSci Survey (328k points)
Did you drag the question RG01 on the page above (!) the PHP code?

If yes, please kindly open a new question (you may use the "ask related question" button above), because the comments quickly get confusing :)

Please also post the complete debug information of that page in the new question.
by s131273 (100 points)
I figured out the problem!
For those who also encounter this issue in the future, this PHP code worked for me to display the RG01 code value on the survey page, so that it is visible to participants:

html('<p>Your code is <strong>'.value('RG01').'</strong>.</p>');
by SoSci Survey (328k points)
Please note that this will display only the number (internal code) drawn by the random generator. If you imported only numbers, and no strings (codes with letters), then this may be the correct solution.

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

...