Das ist mein jetziger Code, ich weiß leider nicht, wo ich ihn entsprechend anpassen muss.
if (!isset($blocks)) {
$fragen = array('VA01', 'VA02', 'VA03', 'VA04');
$items = array(
array('VA01', 1),
array('VA01', 2),
array('VA01', 3),
array('VA02', 1),
array('VA02', 2),
array('VA02', 3),
array('VA03', 1),
array('VA03', 2),
array('VA03', 3),
array('VA04', 1),
array('VA04', 2),
array('VA04', 3),
);
foreach ($fragen as $frage) {
$itemsF = getItems($frage, 'all');
foreach ($itemsF as $itemID) {
$items[] = array($frage, $itemID);
}
}
shuffle($items);
$blocks = array_chunk($items, 6);
registerVariable($blocks);
}
$i = loopPage(count($blocks));
foreach ($blocks[$i] as $pos => $item) {
$frage = $item[0];
$itemID = $item[1];
if ($pos == 0) {
question($frage, $itemID, 'spacing=5');
} elseif ($pos == 9) {
question($frage, $itemID, 'anchor=none');
} else {
question($frage, $itemID, 'spacing=5', 'anchor=none');
}
}