- Posts: 10
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
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.
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.
Je le sais, mais: Cela n'a pas été mentionné jusqu'à présent.@Joffm : @martinbelot utilise déjà une méthode pour ne faire apparaître que 10 questions sur les 100 disponibles par groupe
<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(){ // Fülle das Array hier Zahlen von 1 - 500 var arr = []; for (var i = 1; i < 101; i++) { var i2='000'+i; arr.push(i2.slice(-3)); } // Würfele durcheinander arr = shuffle(arr); // Nimm die ersten fünf und füge sie zu einem Text zusammen, mit „#“ getrennt arr = arr.slice(0,10).join('/'); // Schreibe die ersten fünf in die Frage $('#question{QID} input[type="text"]').val('/'+arr+'/'); // Verstecke diese Frage // $('#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.