Hi,
I have two separate sections with 72 questions each.
I need to present specific 24 questions from one section and specific 24 questions from the other section in a random order on the same page.
I know how to do it if drawing the questions from one section only.
I tried to adapt the code to draw the questions from both sections (I'm pasting it below).
However, I never get presented all 48 items and I cannot find the error. I can think of that e.g. $questionsNN is not registered as an array, therefore array_merge is inappropriate, and tried to combine it as variables, but that doesn't work either.
Please help!
Thank you in advance.
if (!isset($questionsNN)) {
$questionsNN = array(
'NN01', 'NN02', 'NN11', 'NN12',
'NN15', 'NN16', 'NN19', 'NN20',
'NN29', 'NN30', 'NN33', 'NN34',
'NN37', 'NN38', 'NN47', 'NN48',
'NN51', 'NN52', 'NN55', 'NN56',
'NN65', 'NN66', 'NN69', 'NN70'
);
registerVariable('questionsNN');
}
if (!isset($questionsNQ)) {
$questionsNQ = array(
'NQ01', 'NQ02', 'NQ11', 'NQ12',
'NQ15', 'NQ16', 'NQ19', 'NQ20',
'NQ29', 'NQ30', 'NQ33', 'NQ34',
'NQ37', 'NQ38', 'NQ47', 'NQ48',
'NQ51', 'NQ52', 'NQ55', 'NQ56',
'NQ65', 'NQ66', 'NQ69', 'NQ70'
);
registerVariable('questionsNQ');
}
if (!isset($NE_all)) {
$NE_all = array_merge($questionsNN, $questionsNQ);
shuffle($NE_all);
registerVariable('NE_all');
}
$ne = loopPage(count($NE_all));
question($NE_all[$ne]);
for ($i=0; $i<count($NE_all); $i++) {
$id = id('NN75', $i + 1);
put($id, $NE_all[$i]);
}