Ich versuche gerade kombinierte Fragen zu randomisieren und bekomme das leider nicht hin. Es erscheint zwar keine Fehlermeldung, aber die Fragen sind leider nicht randomisiert. Hat irgendjemand eine Idee? Ich wäre sehr dankbar! Mein Code:
$a = array(question('RC01', 'combine=RC40', 'gap=line'),
question('RC03', 'combine=RC50', 'gap=line'),
question('RC04', 'combine=RC51', 'gap=line'),
question('RC06', 'combine=RC48', 'gap=line'),
question('RC05', 'combine=RC37', 'gap=line'),
question('RC07', 'combine=RC49', 'gap=line'),
question('RC08', 'combine=RC52', 'gap=line'),
question('RC09', 'combine=RC53', 'gap=line'),
question('RC10', 'combine=RC42', 'gap=line'),
question('RC11', 'combine=RC54', 'gap=line'),
question('RC12', 'combine=RC55', 'gap=line'),
question('RC24', 'combine=RC43', 'gap=line'),
question('RC25', 'combine=RC56', 'gap=line'),
question('RC26', 'combine=RC57', 'gap=line'),
question('RC28', 'combine=RC58', 'gap=line'),
question('RC29', 'combine=RC59', 'gap=line'),
question('RC20', 'combine=RC41', 'gap=line'),
question('RC27', 'combine=RC44', 'gap=line'),
question('RC35', 'combine=RC60', 'gap=line'),
question('RC36', 'combine=RC61', 'gap=line'),
question('RC34', 'combine=RC45', 'gap=line'));
shuffle($a);
$a[0];
$a[1];
$a[2];
$a[3];
$a[4];
$a[5];
$a[6];
$a[7];
$a[8];
$a[9];
$a[10];
$a[11];
$a[12];
$a[13];
$a[14];
$a[15];
$a[16];
$a[17];
$a[18];
$a[19];
$a[20];
Mir ist jetzt doch noch eine andere Möglichkeit eingefallen, allerdings spuckt diese mir die Fehlermeldung aus "Die Frage mit der Kennung $b[$a[0]] (usw...) gibt es im Projekt nicht."
$a = array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21);
$b = array('RC37','RC49','RC48','RC40','RC50','RC51','RC41','RC52','RC53','RC42','RC54','RC55','RC43','RC56','RC57','RC44','RC58','RC59','RC45','RC60','RC61');
$c = array('RC05','RC07','RC06','RC01','RC03','RC04','RC20','RC08','RC09','RC10','RC11','RC12','RC24','RC25','RC26','RC27','RC28','RC29','RC34','RC35','RC36');
shuffle($a);
question($c[$a[0]], 'combine=$b[$a[0]]', 'gap=line');
question($c[$a[1]], 'combine=$b[$a[1]]', 'gap=line');
question($c[$a[2]], 'combine=$b[$a[2]]', 'gap=line');
question($c[$a[3]], 'combine=$b[$a[3]]', 'gap=line');
question($c[$a[4]], 'combine=$b[$a[4]]', 'gap=line');
question($c[$a[5]], 'combine=$b[$a[5]]', 'gap=line');
question($c[$a[6]], 'combine=$b[$a[6]]', 'gap=line');
question($c[$a[7]], 'combine=$b[$a[7]]', 'gap=line');
question($c[$a[8]], 'combine=$b[$a[8]]', 'gap=line');
question($c[$a[9]], 'combine=$b[$a[9]]', 'gap=line');
question($c[$a[10]], 'combine=$b[$a[10]]', 'gap=line');
question($c[$a[11]], 'combine=$b[$a[11]]', 'gap=line');
question($c[$a[12]], 'combine=$b[$a[12]]', 'gap=line');
question($c[$a[13]], 'combine=$b[$a[13]]', 'gap=line');
question($c[$a[14]], 'combine=$b[$a[14]]', 'gap=line');
question($c[$a[15]], 'combine=$b[$a[15]]', 'gap=line');
question($c[$a[16]], 'combine=$b[$a[16]]', 'gap=line');
question($c[$a[17]], 'combine=$b[$a[17]]', 'gap=line');
question($c[$a[18]], 'combine=$b[$a[18]]', 'gap=line');
question($c[$a[19]], 'combine=$b[$a[19]]', 'gap=line');
question($c[$a[20]], 'combine=$b[$a[20]]', 'gap=line');
question($c[$a[21]], 'combine=$b[$a[21]]', 'gap=line');