0 votes
in SoSci Survey (dt.) by s091357 (185 points)

We have SoSciSurvey program Version 2.3.05 installed on an Institute Server and need to use this server to collect data due to institutional regulations concerning data protection.
My student prepared a survey on the public SoSciSurvey server with Version 2.6.00-i that we need to migrate to the Institute Server for data collection.
After importing the entire survey, we realized that there are some functions that cannot be found. Most importantly, the "replace" function is not available:

"Fehler im Fragebogen: Im PHP-Code wurde in Zeile 2 eine Funktion replace() verwendet. Es gibt diese Funktion nicht.

PHP-Code

001 $Mobilitaetsform = value('MV04', 'free');
002 replace('%mobilitaetsform%', $Mobilitaetsform);
003 return 'ok';"

We need this function to replace, in a question, a placeholder by the result of a preceding question (the most frequently used means of Transport, e.g. bus, train, car etc.).

What alternative possibilities are there in Version 2.3.05 to attain this functionality?

(We also got another error message that might be related:

Für den Platzhalter mobilitaetsform wurde weder ein Eingabefeld mit prepare_input() vorbereitet, noch ein Inhalt mit set() festgelegt.

Fehler im Fragebogen: Die PHP-Variable $itemsMI wurde verwendet, in diesem PHP-Code aber noch nicht definiert (sie enthält noch keinen Wert).
PHP-Code

001 question('MI03', $itemsMI[1]);
002 return 'ok';)

Thank you for your support!

1 Answer

0 votes
by SoSci Survey (305k points)

I would strongly recommend to upgrade the local server to the latest version of SoSci Survey. There are more than 100 features and optimizations that have been added since 2.3.05. I even doubt that value() in the old version supported the 'free' parameter.

To answer your question: Placeholders used to work with set() in earlier versions:

set('mobilitaetsform', $Mobilitaetsform);

Fehler im Fragebogen: Die PHP-Variable $itemsMI wurde verwendet, in diesem PHP-Code aber noch nicht definiert (sie enthält noch keinen Wert).

Hard to answer without the full PHP code, but probably there is no $itemsMI = ... in the code, that actually sets the content of the variable.

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

...