Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Search Results (Searched for: random)

30 Nov 2025 20:26 - 30 Nov 2025 20:28
Replied by Joffm on topic Zufällige Fragen auswählen
So, es gibt sogar noch eine recht elegante Art, alle Deine Fragen in zufälliger Reihenfolge anzuzeigen.
In einer ersten Gruppe erstelle 15 versteckte Gleichungsfragen (ich nenne sie hier R1-R15), alle  mit dem üblichen Konstrukt {if(is_empty(self),rand(1,1000000),self)}
Damit bekommst Du 15 Zufallszahlen.

In der eigentlichen Fragegruppe erstellst Du alle 21 Fragen mit demselben Randomisierungsgruppennamen.
Und um die 6 aus 15 auszuwählen, nimmst Du einfach die 6 größten der 15 Zufallszahlen.

Und zwar so /wieder unwichtige Fragen zur Verdeutlichung U1, U2,..., U15 genannt)

U1: Bedingung: countifop('>',R1,R2,R3,R4,R5,R6,R7,R8,R9,R10,R11,R12,R13,R14,R15)<6
D.h. ist die Zahl der Zufallszahlen, die größer als R1 ist, kleiner als 6? Dann muss U1 ja angezeigt werden.

U2: Bedingung: countifop('>',R2,R1,R3,R4,R5,R6,R7,R8,R9,R10,R11,R12,R13,R14,R15)<6
U3: Bedingung: countifop('>',R3,R1,R2,R4,R5,R6,R7,R8,R9,R10,R11,R12,R13,R14,R15)<6
U4: Bedingung: countifop('>',R4,R1,R2,R3,R5,R6,R7,R8,R9,R10,R11,R12,R13,R14,R15)<6
usw.
U14: Bedingung: countifop('>',R14,R1,R2,R3,R4,R5,R6,R7,R8,R9,R10,R11,R12,R13,R15)<6
U15: Bedingung: countifop('>',R15,R1,R2,R3,R4,R5,R6,R7,R8,R9,R10,R11,R12,R13,R14)<6

Die wichtigen erhalten ja keine Bedingung, da sie immer angezeigt werden.

Halte ich für ziemlich chic.

Joffm
30 Nov 2025 17:09
Replied by Joffm on topic Zufällige Fragen auswählen
Hallo,
es gibt noch eine kleine Nachfrage.
Sollen die sechs "wichtigen" Fragen zwar in zufälliger Reihenfolge, aber trotzdem vor den 6 "unwichtigen" Fragen stehen?
Oder soll alles gut durchgemischt sein?

Wenn alle 12 wirklich total durchgemischt erscheinen sollen, wird es etwas schwierig; zwar möglich, aber etwas umständlich.
(Ich gehe davon aus, dass Du kein javascript benutzen darfst; falls doch, ist alles easy)

Falls Du mit einer kleinen Einschränkung leben kannst, ist es ebenfalls recht simpel.

Erstelle zwei Gruppen:
(Ich bezeichne die wichtigen Fragen einmal mit W1-W6, die anderen mit U1-U15)
G1:
W1: Randomisierungsgruppenname: RF1
W2: Randomisierungsgruppenname: RF1
W3: Randomisierungsgruppenname: RF1
W4: Randomisierungsgruppenname: RF1
W5: Randomisierungsgruppenname: RF1
W6: Randomisierungsgruppenname: RF1
U1: Randomisierungsgruppenname: RF2
U2: Randomisierungsgruppenname: RF2
U3: Randomisierungsgruppenname: RF2
U4: Randomisierungsgruppenname: RF2
U5: Randomisierungsgruppenname: RF2
U6: Randomisierungsgruppenname: RF2

G2: Bedingung: 0  (d.h. diese Gruppe wird nicht gezeigt)
U7: Randomisierungsgruppenname: RF2
U8: Randomisierungsgruppenname: RF2
U9: Randomisierungsgruppenname: RF2
U10: Randomisierungsgruppenname: RF2
U11: Randomisierungsgruppenname: RF2
U12: Randomisierungsgruppenname: RF2
U13: Randomisierungsgruppenname: RF2
U14: Randomisierungsgruppenname: RF2
U15: Randomisierungsgruppenname: RF2

Dies bewirkt, dass die erste Gruppe gezeigt wird, die sechs wichtigen Fragen werden innerhalb ihrer Randomisierungsgruppe verwürfelt.
Die unwichtigen Fragen werden ebenfalls innerhalb ihrer Randomisierungsgruppe verwürfelt, aber nur die sechs die in G1 landen, werden gezeigt.
Und zwar werden zuerst die 6 wichtigen, dann irgendwelche 6 unwichtigen Fragen gezeigt. (An dieser Reihenfolge wird ja nichts geändert)

Wenn nun wichtig und unwichtig ebenfalls abwechseln sollen, kannst Du es so einrichten:
G1:
W1: Randomisierungsgruppenname: RF1
U1: Randomisierungsgruppenname: RF2
W2: Randomisierungsgruppenname: RF1
U2: Randomisierungsgruppenname: RF2
W3: Randomisierungsgruppenname: RF1
U3: Randomisierungsgruppenname: RF2
W4: Randomisierungsgruppenname: RF1
U4: Randomisierungsgruppenname: RF2
W5: Randomisierungsgruppenname: RF1
U5: Randomisierungsgruppenname: RF2
W6: Randomisierungsgruppenname: RF1
U6: Randomisierungsgruppenname: RF2

G2 bleibt wie sie ist.

Damit wird immer abwechselnd eine zufällige wichtige und eine zufällige unwichtige Frage gezeigt.
Das ist m.E. genügend zufällig.

Die umständlichere Lösung wäre:
Alle Fragen in einer Gruppe mit demselben Randomisierungsgruppennamen.
Vorher werden 6 Zufallszahlen zwischen 1 und 15 erzeugt und die unwichtigen Fragen mit der Bedingung "nicht in den 6 Zufallszahlen enthalten" werden ausgeblendet.
Wie schon gesagt, diese 6 Zahlen kann man gut und schnell mit javascript erzeugen, aber auch rein mit Bordmitteln.
Dazu kannst Du einmal mein "Tutorial 4: Gleichungen, Zufall,...", Kap. 3.2.2. anschauen 
[url] forums.limesurvey.org/forum/german-forum...-gleichungen,-zufall [/url]
Das Schema auf Seite 19 ist das Entscheidende. Da Du ja 6 aus 15 benötigst, also bei Zahlen zweistellige Werte, ist es hier besser statt der Zahlen Buchstaben zu benutzen; es geht ja nur darum irgendwelche Kennzeichen zu haben.
Wie Du dies dann benutzt, steht auf den beiden folgenden Seiten.

Bis dann
Joffm
30 Nov 2025 14:45
Replied by holch on topic Zufällige Fragen auswählen
Erstmal eines vorne weg, also die LS 3.28.22+220802 ist so eine alte Krücke, die ist sicher nicht in der Limesurvey Cloud gehostet, sondern wohl selbsthosting oder von irgendeiner Uni oder irgendeinem Arbeitgeber und die verantwortliche Person kümmert sich nicht wirklich um Updates.

Das Ding ist jetzt seit über 3 Jahren ohne Updates. Da wäre ein Update bzw. ein Upgrade dringend angeraten. Diese Version ist sicher nicht "state of the art" Software wie von der DSVGO gefordert.

So, jetzt genug Beschwerden. :-)

Zu deinem Thema: Dazu gibt es hier im Forum ziemlich viele Beschreibungen.

Es kommt ein bisschen darauf an, wie die Umfrage darstellst:
Beides, die 6 wichtigsten und die 12 anderen Fragen zusammen randomisieren geht meiner Meinung nach nicht.

Was du brauchst ist eine gute Struktur von Fragengruppen und Randomisierungsgruppen.

Machen wir mal das einfachste Beispiel: Die 6 Basisfragen randomisiert (alle in der gleichen Randomisierungsgruppe) und danach dann die weitere 6 Fragen aus dem Pool von 15 Restfragen.

Du erstellst die 15 Fragen und gibst ihnen allen den gleichen Code bei "Randomisierungsgruppe" auf Fragenebene. Diese Fragen werden dann zufällig an irgendeiner Position dieser 15 Fragen dargestellt. Jetzt hast du die Fragen an zufälligen Positionen, aber du willst ja nicht alle 15, sondern nur 6. Dazu versteckst du einfach per GUI 9 von den 15 Fragen.

Was passiert? Du hast 15 positionen und die 15 Fragen werden zufällig auf diese Positionen verteilt. Aber 9 der Positionen sind ja versteckt, d.h. es werden nur 6 dieser 15 Fragen angezeigt und zwar zufällig.
29 Nov 2025 16:03
To avoid the padding you should create a random number between 101 and 406
and
#101:121111
#102:131111
#103:211111
...
#405:312233
#406:322233

If you are allowed to use javascript you may use this - a bit shorter - solution.
In a question of type "short text" insert this script (source code mode):
Code:
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){     do {         var aLinks = [];         var aRechts = [];         aLinks.push(1+Math.floor(Math.random() * 3));         aLinks.push(1+Math.floor(Math.random() * 2));         aLinks.push(1+Math.floor(Math.random() * 3));         aLinks=aLinks.join('');         aRechts.push(1+Math.floor(Math.random() * 3));         aRechts.push(1+Math.floor(Math.random() * 2));         aRechts.push(1+Math.floor(Math.random() * 3));         aRechts=aRechts.join('');     }     while (aLinks==aRechts);     $('#question{QID} input[type="text"]').val(aLinks+aRechts); }); </script>
Here you get at first the three values of the left column, then the three values of the right column.

Joffm
28 Nov 2025 23:21
Bug scheint übrigens heute morgen behoben worden zu sein.

Sollte dann hoffentlich im nächten Update drin sein.
28 Nov 2025 23:16
super, schauen wir mal, ob sich da was tut.

Denn es ist natürlich nicht sinnvoll, dass Antwortoptionen immer mit randomisiert werden.

Das wäre eine echter Dealbreaker, gehe also davon aus, dass das ein Bug ist und hoffentlich bald behoben wird. Und sei es, dass man das Feature wieder rausnimmt, bis es vernünftig funktioniert (mit getrennter Einstellung).
28 Nov 2025 17:56 - 28 Nov 2025 19:23
Hi,
there are many examples in the forum to display something like a conjoint experiment.
All are adapted from a script (tpartner) to merge the radio buttons into the table and the "banana - green apple" design.
 
To get more information you may read my "Tutorial 3: Gimmicks", Kap. 11 in the German part.
[url] forums.limesurvey.org/forum/german-forum...e-spielereien#252902 [/url]

Now your randomization.
You shouldn't create 6 separate random numbers, but
My solution would be
Create a question of type "long text" (pool) and enter all possible positive (those without doubles) combinations as default answer.
As far as I understand there are 324-16 (identicals) =306 valid combinations
Like (always three rows with two answer options)
#001:121111
#002:131111
#003:211111
...
#305:312233
#306:322233

Now create ONE random number (eqRand) from 1 to the number of combinations and grab this row in an equation (eqComb)
{substr(pool,strpos(pool,join('#',eqRand))+5,6)}
 And you display easily with an IF construct:
Code:
      <tr>             <td><span style="font-size:16px;"><strong>Wer sollte Gesetze vorschlagen?</strong></span></td>             <td><span style="font-size:16px;">{if(substr(eqComb,0,1) == 1,"Die Europäische Kommission",if(substr(eqComb,0,1) == 2,"Die Europäische Kommission und das Europäische Parlament",if(substr(eqComb,0,1) == 3, "Die Europäische Kommission und der Europäische Rat")))}</span></td>             <td><span style="font-size:16px;">{if(substr(eqComb,1,1) == 1,"Die Europäische Kommission",if(substr(eqComb,1,1) == 2,"Die Europäische Kommission und das Europäische Parlament",if(substr(eqComb,1,1) == 3, "Die Europäische Kommission und der Europäische Rat")))}</span></td>         </tr>


A second solution could be to use javascript to create the final random number.
More or less the same procedure except the option to create a loop that restarts if there are forbidden combinations.

Best you send the lss export of this question.

Joffm
 
28 Nov 2025 16:03
Please help us help you and fill where relevant:
Your LimeSurvey version: [6.16.1]
Own server or LimeSurvey hosting: Own Server
Survey theme/template:
==================
Dear Lime Survey Community,

I am in the process of designing a conjoint experiment. I want to avoid that the two profiles shown in the table are identical. Each row in the conjoint table is determined by two randomization variables. When these variables return the same value, the row in this table will have equal realizations for option a and option b. This is fine as long as it applies only to one row and not to each single row of the table. Because, when that happens, the two options from which respondents are asked to choose are equal, rendering the choice task nonseniscal. I want to avoid this. Can I do this in Lime? Basically, I would need a if-condition that redraws the randomization variables if they are equal for each row in the table.

I have pasted the table code below for reference. If this issue has been raised elsewhere, I am sorry. This is my first post here. Please point me in the right direction, if there is a solution somewhere in the forum. Thank you very much!

<span style="font-size:16px;">
<style type="text/css">table {
  span-family: arial, sans-serif;
  border-collapse: collapse;
  width: 100%;
}

td, th {
  border: 1px solid black;
  text-align: left;
  padding: 8px;
}

  th:nth-child(1), td:nth-child(1) {
    width: 200px;
  }
  
  th:nth-child(2), td:nth-child(2),
    th:nth-child(3), td:nth-child(3) {
        width: 400px;
  }

tr:nth-child(even) {
  background-color: #dddddd;
}
</style>
</span>
<table>
    <tbody>
        <tr>
            <th> </th>
            <th><span style="font-size:16px;">Vorschlag A</span></th>
            <th><span style="font-size:16px;">Vorschlag B</span></th>
        </tr>
        <tr>
            <td><span style="font-size:16px;"><strong>Wer sollte Gesetze vorschlagen?</strong></span></td>
            <td><span style="font-size:16px;">{if(M1CT1rand1a == 1,"Die Europäische Kommission",if(M1CT1rand1a == 2,"Die Europäische Kommission und das Europäische Parlament",if(M1CT1rand1a == 3, "Die Europäische Kommission und der Europäische Rat")))}</span></td>
            <td><span style="font-size:16px;">{if(M1CT1rand1b == 1,"Die Europäische Kommission",if(M1CT1rand1b == 2,"Die Europäische Kommission und das Europäische Parlament",if(M1CT1rand1b == 3, "Die Europäische Kommission und der Europäische Rat")))}</span></td>
        </tr>
        <tr>
            <td><span style="font-size:16px;"><strong>Wer sollte über die Gesetzesvorschläge entscheiden?</strong></span></td>
            <td><span style="font-size:16px;">Der Ministerrat und das Europäisches Parlament</span></td>
            <td><span style="font-size:16px;">Der Ministerrat und das Europäisches Parlament</span></td>
        </tr>
        <tr>
            <td><span style="font-size:16px;"><strong>Wer sollte Gesetze durchsetzen?</strong></span></td>
            <td><span style="font-size:16px;">{if(M1CT1rand3a == 1,"Die Europäische Kommission",if(M1CT1rand3a == 2,"Die Europäische Kommission, aber der Europäische Rat kann Entscheidungen der Kommission blockieren"))}</span></td>
            <td><span style="font-size:16px;">{if(M1CT1rand3b == 1,"Die Europäische Kommission",if(M1CT1rand3b == 2,"Die Europäische Kommission, aber der Europäische Rat kann Entscheidungen der Kommission blockieren"))}</span></td>
        </tr>
        <tr>
            <td><span style="font-size:16px;"><strong>Wer sollte Gesetze aussetzen können?</strong></span></td>
            <td><span style="font-size:16px;">{if(M1CT1rand4a == 1, "Der Ministerrat zusammen mit dem Europäischen Parlament im Rahmen des normalen Gesetzgebungsverfahrens", if(M1CT1rand4a == 2,"Der Europäischer Rat durch Notfallentscheidungen", if(M1CT1rand4a == 3, "Die Europäische Kommission durch Notfallentscheidungen")))}</span></td>
            <td><span style="font-size:16px;">{if(M1CT1rand4b == 1, "Der Ministerrat zusammen mit dem Europäischen Parlament im Rahmen des normalen Gesetzgebungsverfahrens", if(M1CT1rand4b == 2,"Der Europäische Rat durch Notfallentscheidungen", if(M1CT1rand4b == 3, "Die Europäische Kommission durch Notfallentscheidungen")))}</span></td>
        </tr>
    </tbody>
</table>

<p> </p>

 
28 Nov 2025 15:49
Please help us help you and fill where relevant:
Your LimeSurvey version: [ 6.16.1 ]
Own server or LimeSurvey hosting: Own Server
Survey theme/template:
==================
Dear Lime Community,

I am currently working on designing a conjoint table with two profiles. Respondents are asked to choose between one of the two profiles. The table is based on radomized variables. Because there is only a total of 18 profile options, there is a rather high likelihood that respondents will see two identical profiles. This is a situation, we want to avoid, because it does not make much sense to ask people about which option they prefer if the provided options are identical. 

Is there a way in which we can "redraw" the random variables, when this happens? I am imagining a if-condition that specifies a condition in which all of the two randomization variables for each row of the table are equal. When this condition is met, all randomization variables should be drawn again, until the two options are different (i.e. there is at least one row, where the randomization variables are not equal to one another).

Below you'll find the table code. Apologies, if this issue has been adressed elsewhere already. This is my first forum post. If that is the case, please point me in the right direction. Thanks heaps!!

<span style="font-size:16px;">
<style type="text/css">table {
  span-family: arial, sans-serif;
  border-collapse: collapse;
  width: 100%;
}

td, th {
  border: 1px solid black;
  text-align: left;
  padding: 8px;
}

  th:nth-child(1), td:nth-child(1) {
    width: 200px;
  }
  
  th:nth-child(2), td:nth-child(2),
    th:nth-child(3), td:nth-child(3) {
        width: 400px;
  }

tr:nth-child(even) {
  background-color: #dddddd;
}
</style>
</span>
<table>
    <tbody>
        <tr>
            <th> </th>
            <th><span style="font-size:16px;">Vorschlag A</span></th>
            <th><span style="font-size:16px;">Vorschlag B</span></th>
        </tr>
        <tr>
            <td><span style="font-size:16px;"><strong>Wer sollte Gesetze vorschlagen?</strong></span></td>
            <td><span style="font-size:16px;">{if(M1CT1rand1a == 1,"Die Europäische Kommission",if(M1CT1rand1a == 2,"Die Europäische Kommission und das Europäische Parlament",if(M1CT1rand1a == 3, "Die Europäische Kommission und der Europäische Rat")))}</span></td>
            <td><span style="font-size:16px;">{if(M1CT1rand1b == 1,"Die Europäische Kommission",if(M1CT1rand1b == 2,"Die Europäische Kommission und das Europäische Parlament",if(M1CT1rand1b == 3, "Die Europäische Kommission und der Europäische Rat")))}</span></td>
        </tr>
        <tr>
            <td><span style="font-size:16px;"><strong>Wer sollte über die Gesetzesvorschläge entscheiden?</strong></span></td>
            <td><span style="font-size:16px;">Der Ministerrat und das Europäisches Parlament</span></td>
            <td><span style="font-size:16px;">Der Ministerrat und das Europäisches Parlament</span></td>
        </tr>
        <tr>
            <td><span style="font-size:16px;"><strong>Wer sollte Gesetze durchsetzen?</strong></span></td>
            <td><span style="font-size:16px;">{if(M1CT1rand3a == 1,"Die Europäische Kommission",if(M1CT1rand3a == 2,"Die Europäische Kommission, aber der Europäische Rat kann Entscheidungen der Kommission blockieren"))}</span></td>
            <td><span style="font-size:16px;">{if(M1CT1rand3b == 1,"Die Europäische Kommission",if(M1CT1rand3b == 2,"Die Europäische Kommission, aber der Europäische Rat kann Entscheidungen der Kommission blockieren"))}</span></td>
        </tr>
        <tr>
            <td><span style="font-size:16px;"><strong>Wer sollte Gesetze aussetzen können?</strong></span></td>
            <td><span style="font-size:16px;">{if(M1CT1rand4a == 1, "Der Ministerrat zusammen mit dem Europäischen Parlament im Rahmen des normalen Gesetzgebungsverfahrens", if(M1CT1rand4a == 2,"Der Europäischer Rat durch Notfallentscheidungen", if(M1CT1rand4a == 3, "Die Europäische Kommission durch Notfallentscheidungen")))}</span></td>
            <td><span style="font-size:16px;">{if(M1CT1rand4b == 1, "Der Ministerrat zusammen mit dem Europäischen Parlament im Rahmen des normalen Gesetzgebungsverfahrens", if(M1CT1rand4b == 2,"Der Europäische Rat durch Notfallentscheidungen", if(M1CT1rand4b == 3, "Die Europäische Kommission durch Notfallentscheidungen")))}</span></td>
        </tr>
    </tbody>
</table>

<p> </p>

 
Displaying 226 - 234 out of 234 results.

Lime-years ahead

Online-surveys for every purse and purpose