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

Hi all, I have a set of 32 different texts and questions.

I would like to, at random, distribute each set of text/question to my respondents whereby each respondent randomly receives 10 sets of text/questions.

Also preferably I would like each set of text/question to be equally weighted drawn from the set of 32 text/questions.

My structure goes like this.

Text1 - Q11,Q12,Q13,Q14,Q15

Text2 - Q21,Q22,Q23,Q24,Q25
...
Text32 - Q321, Q322, Q323, Q324, Q325

Please help.

Thank you very much in advance.

1 Answer

0 votes
by SoSci Survey (304k points)
edited by SoSci Survey

I'd suggest to use a "random generator" question, which can draw 10 sets (per interview) randomly from the 32 while taking care for equal distribution.

When you have drawn the 10 sets, there are different options how to present them in the questionnaire. I personally would use loopPage() together with som arrays. As you can define texts like questions in SoSci Survey, it's quite easy. Assuming that your text and questions from set 1 have the IDs A010 (the text), A011, A012, A013, A014, and A015 (and so on), you'd define an array assigning the drawn numbers to these sets:

$sets = array(
  1 => array('A010', 'A011', 'A012', 'A013', 'A014', 'A015'),
  2 => array('A110', 'A111', 'A112', 'A113', 'A114', 'A115'),
  // and so on
);

Then you create an array with all IDs to present:

$drawn = valueList('RG01');
$ids = array();
foreach ($drawn as $code) {
  $ids = array_merge($ids, $sets[$code]);
}
registerVariable($ids);

And finally, you present one after the other:

$i = loopPage(count($ids));
show($ids[$i]);

Looks weired? You shall probably read the chapter on arrays in the manual :)

by s091600 (110 points)
Dear sir/madam,

Please bare with me as I am new to the website and coding.

1. Where do I put the codes? In the Codes (contents) in the Ballot for the Random Drawing and what codes do I put it in? or the questionnaire page in the PHP code content.

2. I get the error The funktion getValues() is not known.

3. In the questionnaire page, do I add both the RG01 and the PHP code in the questionnaire page as well?

4. Do I need to put all the question sets in the questionnaire page?

Please kindly be patient thanks in advance!

Yours Sincerely,
by SoSci Survey (304k points)
> 1. Where do I put the codes? In the Codes (contents) in the Ballot for the Random Drawing and what codes do I put it in? or the questionnaire page in the PHP code content.

The "Codes" for your random generator are just 32 set descriptions, they will get a numeric code from 1..32 assigned before each.

The PHP code i have posted above, goes into a PHP element in "compose" questionaire - just where you'd like to display the 10 sets. You need only one (!) page for all 10 sets.

> 2. I get the error The funktion getValues() is not known.

Sorry, that must be valueList(), I'll change that above.

> 3. In the questionnaire page, do I add both the RG01 and the PHP code in the questionnaire page as well?

Yes.

> 4. Do I need to put all the question sets in the questionnaire page?

No, question() does that for you. Don't do it twice :)
by s091600 (110 points)
Dear SoSci Survey,

You saved my life!

Cheers!!!

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

...