Hello,
I'm trying to make a lengthy survey with multiple instruments used.
I want to shuffle different instruments in order to avoid biasing the data.
I want to do the following:
- Shuffle a group of instruments between the first page and the second to last page (one instrument should always come first; a page with demographic question and another page with external link should always be in the end)
I also want to
- Shuffle pages within certain instruments; some instruments take up multiple pages - a block (intro page with explanation + multiple stimuli in an instrument); I always want to display explanation first, then shuffle the stimuli/pages within this block
How can I ensure this nesting of shuffleing?
I created following set of codes, one for high-level shuffle, and one for in-block shuffle.
But the issue is - some pages are displayed twice, while other pages are not displayed at all. I don't know why.
BLOCK SHUFFLE
$pages = [
['MFQ11', 'MFQ12'],
['MFQ2'],
['OPVINJ', '*RandomVinj*', 'A1', 'A2', 'A3', 'B1', 'B2', 'B3', 'C1', 'C2', 'C3', 'D1', 'D2', 'D3', 'E1', 'E2', 'E3', 'K1', 'K2', 'K3'],
['sgi', '*randomsilg*', 's1', 's2', 's3', 's4', 's5', 's6', 's7', 's8', 's9', 's10', 's11', 's12', 's13', 's14', 's15', 's16'],
['CRT', '*randomCRT*', 'c1', 'c2', 'c3', 'c4', 'c5', 'c6', 'c7', 'c8', 'c9', 'c10', 'c11', 'c12', 'c13', 'c14', 'c15', 'c16', 'c17'],
['imhs', 'MHS'],
['CTSQ']
];
// Shuffle the parent array
shuffle($pages);
// Use as page order
setPageOrder($pages, 'demo');
Then I have another code to shuffle some pages within a block. Here's an example:
question('RG01');
$pages = valueList('RG01', NULL, 'label');
setPageOrder($pages, 'sgi');
Can someone help me determine why it's bugging and how to fix it?
Thx!