0 votes
in SoSci Survey (English) by s192328 (110 points)

Hello,

We would like to give respondents the opportunity to come back in the future and fill in any outstanding information. To that end, we thought we could assign a random code that they could enter into a specific question in the future. This way we can link both survey entries together. To do that we will need to: (a) give a random code to the respondent, and (b) save the given code.

We have tried the following:

if (value($D101)>0){
  suffle($D101);
  print($D101);
  registerVariable($D101)
}

However, However, a warning appears about the impossibility of using the "print" command ("The PHP keyword print is not allowed within PHP code").

What could be a solution? Is there any way to allow a person to return to complete/edit a questionnaire without saving personal information of the respondent?

Best

1 Answer

0 votes
by SoSci Survey (328k points)

I think this code is wrong in many aspects. First, it's most likley value('D101'), then shere is no suffle(), but a shuffle() - but you don't need any shuffle here, in my opinion. And then registerVariable() does not make sense in the context.

If you just wanted to display the code in some context, please use html(value('D101')) - html() works correctly, while print() won't.

Or, more elegantly, use placeholders and replace('%code%', 'D101', 'response');

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

...