Each question consists out of 4 items. I want to be able to analyse those afterwards seperately but show them in my survey in one question with in a random order.
My PHP-Code shows just the text ofthe first question, not the items of all 4 questions. What do I need to adjust?
$fragen = ['HU01', 'HU02', 'HU03', 'HU04'];
$itemliste = [];
foreach ($fragen as $frage) {
foreach (getItems($frage, 'all') as $item) {
$itemsliste[] = [$frage, $item];
}
}
// Mischen
if (!isset($itemMix)) {
$itemMix = $itemliste;
registerVariable($itemMix);
}
// Fragetext anzeigen
question('HU01', 'show-items=no', 'spacing=0');
foreach ($itemliste as $info) {
$frage = $info[0];
$item = $info[1];
question($frage, $item, 'show-title=no', 'show-explanation=no', 'spacing=0');
}
// Items einzeln anzeigen
foreach ($itemMix as $info) {
$frage = $info[0];
$item = $info[1];
question($frage, $item, 'show-title=no', 'show-explanation=no', 'spacing=0');
}