- Posts: 29
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
Please Log in to join the conversation.
The problem is:Each respondent gets 6 choice tasks out of a total of 108, both for the first and the second stated choice experiment.
Each choice tasks has two questions (Type: bootstrap buttons).
For both experiments 108 question groups are created with two questions (tasks) per question group (page)
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
And exactly this is the problem.only difference with this survey is, that the question groups consist of two questions in stead of one.
<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 ; here you have to change to 109 var arr = ; for (var i = 1; i < 19; i++) { arr.push(i); } arr = shuffle(arr).slice(0,6).join('-'); // we capture the first six elements of the shuffled array $('#question{QID} input[type="text"]').val('#-'+arr+'-'); $('#question{QID}').hide(); }); </script>
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.