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!