0 votes
in SoSci Survey (English) by s126407 (215 points)
edited by SoSci Survey

Hi,
I'm running an experiment, with 6 groups of randomly assigned participants.
Each group will see the same demographic questions at the beginning and the same questions at the end of the questionnaire starting from page N1 (it is in the PHP code i pasted), but in the middle, each group will be presented with their own set of 9 blocks of pages, and 8 of these blocks of pages should be presented in a random order, except for the first block, which is practice, and in every group should retain the first position.
For assigning people to groups, I'm using the random generator. I'm, I think, clear on creating blocks and random presentation of particular blocks of pages for each group, but I can't manage to find the right instruction for fixing the first page-block in position 0. Here is the part of the code (if 1 or 2 is drawn, there are in total 6 groups), I didn't copy everything as codes for groups 3 to 6 differ only by page IDs.

My question is, what code should I add to fix the 'DUMMY250' in position 0 for group 1, and to fix 'DUMMY500' in position 0 for group 2?

if (value('RG01') == 1) {
$random250 = array(
'DUMMY250' => array('D11','D11K','D12','D12K','D13','D13K'),
  'PAT250' => array('1','2'),
  'ATL250' => array('3','4'),
  'GAL250' => array('5','6'),
  'LOK250' => array('7','8'),
  'MOC250' => array('9','10'),
  'REK250' => array('11','12'),
  'STA250' => array('13','14'),
  'SVI250' => array('15','16'),
);
shuffle($random250);
setPageOrder($random250, 'N1');
} 
elseif (value('RG01') == 2)  {
  $random500 = array(
'DUMMY500' => array('D21','D21K','D22','D22K','D23','D23K'),
  'PAT500' => array('17','18'),
  'ATL500' => array('19','20'),
  'GAL500' => array('21','22'),
  'LOK500' => array('23','24'),
  'MOC500' => array('25','26'),
  'REK500' => array('27','28'),
  'STA500' => array('29','30'),
  'SVI500' => array('31','32'),
);
shuffle($random500);
setPageOrder($random500, 'N1');
}

N1 is the page on which each group should land after going through the set page order, so this part is the same throughout the code.
RG01 is the random generator question id.

Thank you!

1 Answer

0 votes
by SoSci Survey (305k points)

in the middle, each group will be presented with their own set of 9 blocks of pages

How do these pages differ? I ask, because it may be easier to randomize and rotate the contents than the pages.

what code should I add to fix the 'DUMMY250' in position 0 for group 1, and to fix 'DUMMY500' in position 0 for group 2?

Before I can answer that, I have a question as well: What do the numbers mean? Page IDs shall not be numbers (as they could be confused with the page numbers).

What I can tell you is the basic idea: Remove the fixed block in the original array, then shuffle(), and then add it to the beginning:

$random250 = array(
  'PAT250' => array('1','2'),
  'ATL250' => array('3','4'),
  'GAL250' => array('5','6'),
  'LOK250' => array('7','8'),
  'MOC250' => array('9','10'),
  'REK250' => array('11','12'),
  'STA250' => array('13','14'),
  'SVI250' => array('15','16'),
);
shuffle($random250);
array_unshift($random250,  ['D11','D11K','D12','D12K','D13','D13K']);

Or, you could also array_merge() instead of the array_unshift():

$random250 = array(
  'PAT250' => array('1','2'),
  'ATL250' => array('3','4'),
  'GAL250' => array('5','6'),
  'LOK250' => array('7','8'),
  'MOC250' => array('9','10'),
  'REK250' => array('11','12'),
  'STA250' => array('13','14'),
  'SVI250' => array('15','16'),
);
shuffle($random250);
$pageList = array_merge(
  [['D11','D11K','D12','D12K','D13','D13K']],
  $random250
);

Note that array-in-array (double brackts) in this case.

by s126407 (215 points)
Thanks, this works perfectly! The numbers are page IDs, since i have a lot of pages, it was easier to ID them with numbers.

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

...