- Posts: 8
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
Please Log in to join the conversation.
Ist die Zufälligkeit der Bilder durch die 50 Optionen gegeben, oder werden die Bilder wiederum aus einem separaten Bilderpool genommen?Insgesamt soll es pro Frage etwa 50 Antwortoptionen geben
und pro Person sollen etwa 10 Vergleiche (Fragen) nacheinander vorgenommen werden.
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 with 50 characters var arr = ["01", "02", "03", "04", "05", "06", "07", "08", "09", 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50]; // Shuffle the array arr = shuffle(arr); arrfinal1 = arr.slice(0,10).join(''); arrfinal2 = arr.slice(10,20).join(''); $('#question{QID} input[type="text"]:eq(0)').val("#"+arrfinal1); $('#question{QID} input[type="text"]:eq(1)').val("#"+arrfinal2); }); </script>
<div class="col-sm-6"><img class="img-responsive center-block" src="/upload/survey/{SID}/images/Bild{substr(QPool_1,1,2)}.jpg" /></div> <div class="col-sm-6"><img class="img-responsive center-block" src="/upload/survey/{SID}/images/Bild{substr(QPool_2,1,2)}.jpg" /></div>
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.