- Posts: 83
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { function shuffleArray(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; } // Identify the questions var thisQuestion = $('#question{QID}'); var thisQuestionID = {QID}; var str = $('#question{QID} input[type="text"]').val(); var arr = str.split(', '); // Shuffle the array arr=shuffleArray(arr); anumbers = '#' + arr.slice(0,3).join(','); // Load the hidden questions with items from the array $('#question{QID} input[type="text"]').val(anumbers); $('#question{QID}').hide(); }); </script>
And this is the reason that we recommend to display "group by group" and put one question into each group.does not work if I hide it, since my survey is question by question and when hiding this question so that it does not show it
I heard in the chat today that there will probably be a release candidate for the LS 4.4 soon (in the next few weeks / months?). So it should still be a bit longer until a stable version is reached.