I have now made duplicates of QE01 and QU02, ranging from QE01 to QE16 (2 questions pr. page), i tried your code, and my php code look like this:
if (!isset($draws)) {
$draws = array_merge(
array_values(valueList('RG01', NULL, 'label')),
array_values(valueList('RG02', NULL,'label')),
);
shuffle($draws);
registerVariable($draws);
}
$questions = [
1 => ['QE01', 'QE02'],
2 => ['QE03', 'QE04'],
3 => ['QE05', 'QE06'],
4 => ['QE07', 'QE08'],
5 => ['QE09', 'QE10'],
6 => ['QE11', 'QE12'],
7 => ['QE13', 'QE14'],
8 => ['QE15', 'QE16'],
];
$i = loopPage(count($draws));
// Show the text
$textID = $draws[$i];
$data = dbGet($textID);
html('<strong>'.$data[0].'</strong>');
html('<p>'.$data[1].'</p>');
//show($questions[$i][0]);
show($questions[$i][1]);
show($questions[$i][2]);
show($questions[$i][3]);
show($questions[$i][4]);
show($questions[$i][5]);
show($questions[$i][6]);
show($questions[$i][7]);
show($questions[$i][8]);
// Store the text ID
put(id('DA01', $i+1), $textID);
However, something is not working as i get errors like:
Questionnaire Error: Undefined array key 0
line: 30
PHP code
027 html('<strong>'.$data[0].'</strong>');
028 html('<p>'.$data[1].'</p>');
029
030 show($questions[$i][1]);
031 show($questions[$i][2]);
032 show($questions[$i][3]);
033 show($questions[$i][4]);
Questionnaire Error: Trying to access array offset on value of type null
line: 30
PHP code
027 html('<strong>'.$data[0].'</strong>');
028 html('<p>'.$data[1].'</p>');
029
030 show($questions[$i][1]);
031 show($questions[$i][2]);
032 show($questions[$i][3]);
033 show($questions[$i][4]);
What did i do wrong here?