Hi,
more or less the same procedure as shown here
[url]
forums.limesurvey.org/forum/can-i-do-thi...-each-question-group
[/url]
Create a question of type "short text" ("Q0") with this javascript snippet in the question text (source code mode).
Here you select ten random numbers out of your ninety.
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 = [];
for (var i = 1; i < 91; i++)
{
w=("00" + i).slice(-2); arr.push(w);
}
arr = shuffle(arr);
anumbers = arr.slice(0,10).join(',');
$('#question{QID} input[type="text"]').val("#"+anumbers);
$('#question{QID}').hide();
$('#ls-button-submit').trigger('click');
});
</script>
You will get something like
#12,02,54,78,23,66,13,45,76,28
Now the relevance equation of each pair of questions is "Does the string contain this number?"
Function "strpos"
Question A1: strpos(Q0,"01")>0
Question B1: strpos(Q0,"01")>0
Question A2: strpos(Q0,"02")>0
Question B2: strpos(Q0,"02")>0
...
Question A34: strpos(Q0,"34")>0
Question B34: strpos(Q0,"34")>0
...
Question A90: strpos(Q0,"90")>0
Question B90: strpos(Q0,"90")>0
All questions have the same randomization group name.
Joffm