0 votes
in SoSci Survey (English) by s276668 (140 points)

Hi!
I have eight pieces of text on one page on my survey and want to randomize the order in which they are shown to participants. In between the texts there are questions; the order of the questions shall remain stable.

How can I randomize the order of the texts?

Thank you!

1 Answer

0 votes
by SoSci Survey (306k points)

For that situation I recommend creating an array with the text IDs and shuffle that.

if(!isset($texts)) {
    $texts = [
         'TX01',
         'TX02',
         'TX03',
         ...
    ];
    shuffle($texts);
    registerVariable($texts);
}

And the to display the texts and questions via PHP code, such as:

text($texts[0]);
question('AB01');
text($texts[1]);
question('AB02');

Note that this will NOT store the information which text was shown at what position. It simply rotates the texts.

by s276668 (140 points)
Thank you! And is there a way I can also store the information which text was shown at what position?
by SoSci Survey (306k points)
Sure, but before doing so, I strongly recommend to consider your data analysis. Do you need to map the answers and the texts? Are the questions all the same?
by s276668 (140 points)
There is always one of the randomized texts followed by two questions and yes, those two questions are always the same but I created different variables for all of them. So for my analysis I would need to know which questions correspond to which texts.
by SoSci Survey (306k points)
Then I recommend this manual: https://www.soscisurvey.de/help/doku.php/en:create:rotation-questions#rotate_questions_together_with_other_content

Instead of loopPage() you would use a FOR loop, and, of course, you'd have three entries per row instead of two (images plus 2 questions).

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

...