Hallo, Jonas,
wenn Du javascript einsetzen kannst, genügt dies:
Füge in die erste Gruppe eine Frage vom Typ "kurzer Text" ein. (eqPool)
In den Quellcode der Frage kommt dann dieses script.
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 arr = ['1','1','1','2','2','2','3','3','3'];
arr = shuffle(arr);
$('#question{QID} input[type="text"].val(arr);
});
</script>
Verstecke die Frage mit der css-Klasse "hidden".
Dann werden die Bilder angezeigt,
Thema 1
PE: substr(eqPool,0,1)=="1"
EQ: substr(eqPool,0,1)=="2"
PEEQ: substr(eqPool,0,1)=="3"
Thema 2
PE: substr(eqPool,1,1)=="1"
EQ: substr(eqPool,1,1)=="2"
PEEQ: substr(eqPool,1,1)=="3"
Thema 3
PE: substr(eqPool,2,1)=="1"
EQ: substr(eqPool,2,1)=="2"
PEEQ: substr(eqPool,2,1)=="3"
usw.
Falls Du nun den "Entscheidungswert" direkt in der Datenbank haben möchtest, z.B. um ohne große Umrechnung in Deinem Analysetool eine Trennvariable für irgendwelche statistischen Tests zu haben (K-Test, ANOVAs, etc.), kannst Du es auch auf diese Weise machen
Füge eine Frage vom Typ "mehrfache kurze Texte" (eqPool) mit 9 Teilfragen ein (1,2,3,...)
Dann iist das script ein wenig unterschiedlich
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 arr = ['1','1','1','2','2','2','3','3','3'];
arr = shuffle(arr);
$('#question{QID} input[type="text"]:eq(0).val(arr[0]);
$('#question{QID} input[type="text"]:eq(1).val(arr[1]);
$('#question{QID} input[type="text"]:eq(2).val(arr[2]);
$('#question{QID} input[type="text"]:eq(3).val(arr[3]);
$('#question{QID} input[type="text"]:eq(4).val(arr[4]);
$('#question{QID} input[type="text"]:eq(5).val(arr[5]);
$('#question{QID} input[type="text"]:eq(6).val(arr[6]);
$('#question{QID} input[type="text"]:eq(7).val(arr[7]);
$('#question{QID} input[type="text"]:eq(8).val(arr[8]);
});
</script>
Dann werden die Bilder angezeigt,
Thema 1
PE: eqPool_1=="1"
EQ: eqPool_1=="2"
PEEQ: eqPool_1=="3"
Thema 2
PE: eqPool_2=="1"
EQ: eqPool_2=="2"
PEEQ: eqPool_2=="3"
usw.
Joffm