Hallo, hier einmal der PHP Code:
if (!isset($blocks)) {
$fragen = array('GN01', 'HC09', 'VN01', 'VN02', 'VN03');
$items = array();
foreach ($fragen as $frage) {
$itemsF = getItems($frage, 'all');
foreach ($itemsF as $itemID) {
$items[] = array($frage, $itemID);
}
}
shuffle($items);
array_splice($items, 50, 0, [['KI01',1]]);
array_splice($items, 100, 0, [['KI01',2]]);
array_splice($items, 150, 0, [['KI01',3]]);
//for ($i=0; $i<count($items); $i++) {
//if ($i < 99) {
//$id = id('I001', $i + 1);
//} elseif ($i > 197) {
//$id = id('I003', $i - 197);
//} else {
//$id = id('I002', $i - 98);
//}
//put($id, $items[$i][0]."_".$items[$i][1]);
//}
$blocks = array_chunk($items, 12);
registerVariable($blocks);
}
$shading = 'start-shaded';
$i = loopPage(count($blocks));
foreach ($blocks[$i] as $pos => $item)
{
$frage = $item[0];
$itemID = $item[1];
if ($shading == 'start-shaded') {
$shading = 'start-unshaded';
} else {
$shading = 'start-shaded';
}
if ($pos == 0) {
question($frage, $itemID, 'spacing=-1');
} elseif ($pos == 11) {
question($frage, $itemID, 'anchor=none', 'show-title=no', 'show-explanation=no',
'shading='.$shading);
} else {
question($frage, $itemID, 'spacing=-1', 'anchor=none', 'show-title=no', 'show-explanation=no',
'shading='.$shading);
}
}