- Posts: 10
- 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(){ alert("Hallo, hier ist javascript"); }); </script>
Please Log in to join the conversation.
Dies ist dann etwas umständlicher, würde aber auch funktionieren.
<img src=".../links{zufall_links}.jpeg"> <img src=".../rechts{zufall_rechts}.jpeg">
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, hier Zahlen von 1 - 40 var arrL = ; var arrR = ; for (var i = 1; i < 41; i++) { arrL.push(('0'+i).slice(-2)); arrR.push(('0'+i).slice(-2)); } arrL = shuffle(arrL); arrR = shuffle(arrR); arrL = arrL.join(''); arrR = arrR.join(''); $('#question{QID} input[type="text"]:eq(0)').val(arrL); $('#question{QID} input[type="text"]:eq(1)').val(arrR); // Nach dem Testen in dieser letzten Zeile die Schrägstriche entfernen //$('#question{QID}').hide(); }); </script>
<img src="Pfad_zum_Bild/BildL{substr(QPool_1,0,2)}.jpg" /><img src="Pfad_zum_Bild/BildR{substr(QPool_2,0,2)}.jpg" /> <img src="Pfad_zum_Bild/BildL{substr(QPool_1,2,2)}.jpg" /><img src="Pfad_zum_Bild/BildR{substr(QPool_2.2,2)}.jpg" /> <img src="Pfad_zum_Bild/BildL{substr(QPool_1,4,2)}.jpg" /><img src="Pfad_zum_Bild/BildR{substr(QPool_2.4,2)}.jpg" />
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.