- Posts: 29
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
Please Log in to join the conversation.
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ // Identify this question var thisQuestion = $('#question{QID}'); // Create an array of possible numbers var numbers = [1,2,3,4,5,6,7,8]; // Shuffle the numbers array shuffleArray(numbers); var n1=numbers.join(); var n2=n1.replace(/,/g, ''); $('input:text', thisQuestion).val(n2); }); // A function to shuffle arrays function shuffleArray(array) { for (var i = array.length - 1; i > 0; i--) { var j = Math.floor(Math.random() * (i + 1)); var temp = array[i]; array[i] = array[j]; array[j] = temp; } return array; } </script>
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
<iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" frameborder="0" height="315" src="{if(substr(Q0,0,1)=='1',P1_1.shown, if(substr(Q0,0,1)=='2',P1_2.shown, if(substr(Q0,0,1)=='3',P1_3.shown,P1_4.shown)))}" title="YouTube video player" width="560"></iframe>
Please Log in to join the conversation.
Please Log in to join the conversation.