$fragen = [
['AB01', 'p7'],
['AB02', 'p8'],
...
['AB20', 'p26'],
];
Weise ich hier immer ein bestimmtes Triplet einer Seite zu? Da ich die Items ja randomierst den 20 Seiten zuordnen möchte. Hier verwende ich folgenden Code:
//randomize MFC triplets
// shuffle list only once
if (!isset($triplets1)) {
// create a list with question keys
$triplets1 = array(
'M101','M102','M103','M104','M105','M106','M107','M108',
'M109','M110','M111','M112','M113','M114','M115','M116',
'M117','M118','M119','M120');
//shuffle list randomly
shuffle($triplets1);
}
//make variable available to other pages
registerVariable($triplets1);
//test mix in debug mode
debug($triplets1);
//save keys for MFC triplets1
$K_M101 =array_search('M101', $triplets1)+1;
$K_M102 =array_search('M102', $triplets1)+1;
$K_M103 =array_search('M103', $triplets1)+1;
$K_M104 =array_search('M104', $triplets1)+1;
$K_M105 =array_search('M105', $triplets1)+1;
$K_M106 =array_search('M106', $triplets1)+1;
$K_M107 =array_search('M107', $triplets1)+1;
$K_M108 =array_search('M108', $triplets1)+1;
$K_M109 =array_search('M109', $triplets1)+1;
$K_M110 =array_search('M110', $triplets1)+1;
$K_M111 =array_search('M111', $triplets1)+1;
$K_M112 =array_search('M112', $triplets1)+1;
$K_M113 =array_search('M113', $triplets1)+1;
$K_M114 =array_search('M114', $triplets1)+1;
$K_M115 =array_search('M115', $triplets1)+1;
$K_M116 =array_search('M116', $triplets1)+1;
$K_M117 =array_search('M117', $triplets1)+1;
$K_M118 =array_search('M118', $triplets1)+1;
$K_M119 =array_search('M119', $triplets1)+1;
$K_M120 =array_search('M120', $triplets1)+1;
put('KE01_01', $K_M101);
put('KE01_02', $K_M102);
put('KE01_03', $K_M103);
put('KE01_04', $K_M104);
put('KE01_05', $K_M105);
put('KE01_06', $K_M106);
put('KE01_07', $K_M107);
put('KE01_08', $K_M108);
put('KE01_09', $K_M109);
put('KE01_10', $K_M110);
put('KE01_11', $K_M111);
put('KE01_12', $K_M112);
put('KE01_13', $K_M113);
put('KE01_14', $K_M114);
put('KE01_15', $K_M115);
put('KE01_16', $K_M116);
put('KE01_17', $K_M117);
put('KE01_18', $K_M118);
put('KE01_19', $K_M119);
put('KE01_20', $K_M120);
//show first triplet
question($triplets1[0]);
Gibt es eine Möglichkeit, diese beiden Ansätze zu vereinen?
"Wenn Sie die Zahl nur am Ende brauchen, dann machen Sie alles in einem Aufwasch" -> das finde ich sehr gut!
Vielen Dank schonmal für die erneute Antwort!
Viele Grüße
Vielen Dank schonmal!