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

How do I randomize a questionnaire so that half the participants get a questionnaire with a blue background color and the other half gets a questionnaire with the regular background color (white)

1 Answer

0 votes
by SoSci Survey (306k points)

The easiest way was to put a placeholder in the layout where the background color is defined, something like this CSS code in the <style> section:

body {
    background-color: white;
    background-color: %experiment%;
}

And then to define the placeholder based on a random generator on the first page:

show('RG01')
if (value('RG01') == 1) {
  replace('%experiment%', '#FF9900');
} else {
  replace('%experiment%', '#0099FF');
}

Keep in mind, that the very last page, will not use this color.

by s084144 (110 points)
edited by s084144
HI, Thanks for your answer.
Does that mean, that I should have access to the php code directly? im afraid I am not authorized to make these changes. is there any other way to manage the change from the administration page.
by SoSci Survey (306k points)
Sosci Survey intends to use PHP code in the questionnaire. Take a look here:
https://www.soscisurvey.de/help/doku.php/en:create:php

No special authorization required ;)

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

...