- Posts: 17
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
arr = [[img1, img2], [img1, img3], ... , [img1, imgn], ..., [img(n-1), imgn]]
<img alt="" src="/upload/surveys/248689/images/{arr[1][1]}.jpg" />
<script type="text/javascript" charset="utf-8"> let arr = [[11, 12], [11, 13]]; </script>
<img alt="" src="/upload/surveys/248689/images/{arr[1][1]}.jpg" />
Please Log in to join the conversation.
Please Log in to join the conversation.
$('#question{QID} :text').val('...my value...').trigger('keyup');
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.
<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 < 10; i++) { for (var j = 1; j < 7; j++) { for (var k = j+1; k < 8; k++) { arr.push(i.toString() + j.toString()+ i.toString()+ k.toString()); } } } arr = shuffle(arr); arr = arr.slice(0,20); for (var x = 0; x < 20; x++) { $('#question{QID} input[type="text"]:eq('+x+')').val(arr[x]); } }); </script>
Please Log in to join the conversation.
Please Log in to join the conversation.