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

0 votes

Good morning :) I couldn't generate an Mturk code, I tried several possibilities I found on the web, but nothing works (the code doesn't work for some reason). I tried to create a new section for "random generator", I put the following code in the question contents, but it doesn't work. I've also dragged the PHP code in the survey page, but the code is apparently not correct. Can you please help?

// Stop right now, if no more codes are available
if (value('RG01_CP') > 0) {

// 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>');

Thank you for your participation in this study! YOUR UNIQUE SURVEY COMPLETION CODE FOR MTURK IS %code%
in SoSci Survey (English) by s139639 (190 points)
edited by SoSci Survey
The code does not look that bad. Did you put codes (e.g. random strings) into the random generator?

And I assume, the "Thank you for your..." is not in the PHP code block, but in a separate text or HTML code?

If yes, what does the page display? Is there an error message? What does the debug information say?
Thank you for your reply. I have attached some screenshots (in the reply section below) so you can understand the probklem. Thank you in advance!

2 Answers

0 votes

Thank you for your response. I have attached some screenshots so you can understand the problem.

by s139639 (190 points)
0 votes

It seems that you have tried to put the PHP code into the random generator (field "codes (contents)"). Please remove them there.

You need to fill this field with unique codes that shall be displayed in the questionnaire as mturk codes.

by SoSci Survey (140k points)