Ja, ich hatte auch diesen Verdacht, und auch, dass ich zu diesem Design schon einmal etwas gesagt habe, diese MM MF, FM, FF-Geschichte zum Beispiel.
Aber sei's drum:
1. Du bildest 35 Gruppen mit den drei Fragen.
Mithilfe dieses javascript snippets. wählst Du die 6 Gruppen aus.
Dazu eine Frage vom Typ "kurzer Text" (Q0). In den Quellcode dies.
Code:
<script type="text/javascript" charset="utf-8">
function shuffle(array) {
var currentIndex = array.length, temporaryValue, randomIndex;
// While there remain elements to shuffle...
while (0 !== currentIndex) {
// Pick a remaining element...
randomIndex = Math.floor(Math.random() * currentIndex);
currentIndex -= 1;
// And swap it with the current element.
temporaryValue = array[currentIndex];
array[currentIndex] = array[randomIndex];
array[randomIndex] = temporaryValue;
}
return array;
}
$(document).on('ready pjax:scriptcomplete',function(){
// Fill the array
var arr1 =["01", "02", "03", "04", "05", "06", "07", "08", "09", 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36];
arr1 = shuffle(arr1);
anumbers = '#,' + arr1.slice(0,6).join(',')+ ',';
$('#question{QID} input[type="text"]').val(anumbers);
$('#question{QID}').hide();
});
</script>
Dann erhälst Du so etwas:
#,12,21,4,7,17,8,
Und dann hat die Gruppenrelevanzgleichung dieses Ausshen:
1. Gruppe: strpos(Q0,',1,')
2. Gruppe: strpos(Q0,',2,')
3. Gruppe: strpos(Q0,',3,')
...
Wenn wir den genauen Aufbau kennen würden, könnte man schauen, inwieweit hier durch Micro-Tayloring kürzere Lösungen möglich sind, zum Beispiel nur 6 Gruppen, in welche die Texte eingepiped werden.
Joffm
if(randnumber > 0, randnumber, rand(1, 35)),
Ist klar; da kommt ja auch nur eine Zahl heraus.
Und wenn Du es einfach wiederholst, geht es erstens nicht,
weil die randnumber ja jetzt >0 ist, und zweitens
weil Du nicht sicher sein kannst, dass keine Zufallszahl zweimal vorkommt.
Und außerdem wäre dazu ein Loop schön; den hat LS aber nicht.