- 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.
Bitte, was hast Du gemacht?für 3. Ich habe mal ein Foto von dem Export gemacht.
Mein screenshot zeigte doch ebenfalls eine Matrix.Also zu 1., da füge ich einfach eine Matrix für die Antwort hinzu
// Nach dem Testen in dieser letzten Zeile die Schrägstriche entfernen
//$('#question{QID}').hide();
Aber bei Dir heißt die Frage "Bilder"In der ersten Gruppe der Umfrage erstellst Du dann eine Frage vom Typ "mehrfache kurze Text" mit zwei Teilfragen (hier kommen dann die zufälligen Werte des linken und rechten Bildes hinein. (Ich habe sie QPool genannt)
hat die Frage "QPool" die Teilfragencodes "1" und "2"; bei Dir sind es aber "LinkesBild" und "Rechts".<img src="Pfad_zum_Bild/BildL{substr(QPool_1,0,2)}.jpg" /><img src="Pfad_zum_Bild/BildR{substr(QPool_2,0,2)}
Please Log in to join the conversation.