Welcome to the LimeSurvey Community Forum

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

Search Results (Searched for: random)

17 Nov 2026 12:58
Please help us help you and fill where relevant:
Your LimeSurvey version:    LimeSurvey Cloud Version 7.11.0
Own server or LimeSurvey hosting:    LimeSurvey hosting
Survey theme/template:  Fruity TwentyThree 
 
I need to fix answer 'None of these' in the end of randomized list,  but after 'Other (specify)'  - e.g. for Brands used in past 3 months (Brand A, Brand B,...  Other (specify), None of these).   

Previously, I've been using JavaScript code for this (I have 3 options of the  code, all found in different forum topics here).  But after the latest LimeSurvey update, all of these stopped working.  I've created a test survey (attached) with 3 versions of script that I have.  All were successfully used in my previous surveys, but none of them works today. 

I know that it is possible to fix a subquestion in the last position through Display menu,  but in that case 'Other (specify)' would still be shown after 'None of these',  while I want 'None of these' in the very end.  
Please suggest how this could be done in the current version of LimeSurvey platform
     
 
11 Nov 2026 13:32 - 11 Nov 2026 13:32
Replied by Mazi on topic Randomisierung bei Limesurvey

Für ein solches 'least filled bucket' Verfahren bräuchte man aber entweder einen Ajax-call (könnt ihr bei der Universion gaaaaaaaaaaaaaaaaaanz sicher nicht mache) oder eben das entsprechende Plugin um auf die Daten aus der Datenbank zugreifen zu können (Statistiken per Experession Skript auslesen). Das werdet ihr auch nicht installieren können. 
Ich greife das Thema hier noch einmal auf, weil es inzwischen bessere Lösungen für einen Least-Fill-Ansatz in LimeSurvey gibt.
Es ist korrekt, dass bei vielen Universitäten oder auch in der Cloud-Version keine Plugins installiert werden können. Das ist eine unschöne Einschränkung, die bei unserem professionellen LimeSurvey-Hosting nicht gegeben ist. Da aber trotzdem viele von diesen Restriktionen betroffen sind, möchte ich einmal auf einen Ansatz verweisen, der statt eines Plugins angepasste Least-Fill-Fragethemes nutzt.
Darüber ist es möglich, innerhalb der Umfrage abzufragen, welche Optionen bisher die wenigsten Zuweisungen haben. Basierend auf diesen Daten kann dann später eine Anzeige der Folgefragen entsprechend gesteuert werden. Ihr könnt euch das unter dieser einfachen Demo-Umfrage einmal anschauen: ls600demo.survey-consulting.com/index.ph...55?newtest=Y&lang=en
Es gibt auch eine erweiterte Version, für welche wir ebenfalls eine Demo-Umfrage erstellt haben: ls600demo.survey-consulting.com/index.ph...49?newtest=Y&lang=en

Bei Fragen zum Setup oder Bereitstellung der Fragethemes bitte einfach melden .
11 Nov 2026 13:21
Replied by Mazi on topic Randomization

b. use a least filled approach with the function "statCountIf"
A very detailed and well structured reply by Joffm, as always :-)

We have developed a custom LimeSurvey question theme to support least fill setups . You can test with this demo survey how the least filed item gets detected:  ls600demo.survey-consulting.com/index.ph...55?newtest=Y&lang=en

There is also an advanced least fill version which you can test at ls600demo.survey-consulting.com/index.ph...49?newtest=Y&lang=en .

These tools may be very helpful when setting up such a complex scenario.
05 Nov 2026 17:23
Thank you so much for taking the time to think this through and for the detailed suggestions, this is really helpful!

I’ll try your first option: a card with the condition label at the end of session 1, and a question at the start of session 2 where participants select it, so the filters show the other condition.

I’ll also think again about whether participants should really generate their own code or whether I should assign one. I really appreciate your help!
 
05 Nov 2026 15:03
Thanks for the background. That helps to understand what you are really doing and thus we can think about how best to run this in practice.

OK, so the code is generated by them and you hope it will be the same for both sessions. I assume most will get it right, some will screw it up though. We always need to think of the worst. But anyway, it is what it is.

So the person creates the code and puts it into a text field so it is stored within the results, so that you can match the datasets from both surveys.

I think the easiest part is what you suggested. You give them a card with a code or letter for what they were chosen for. To make it less suspicious (some people might figure out what A and B is), you could go for numbers from 1-9, with the even numbers being for one option and the odd number for the other, or something like that. But A and B or any other combination should be fine. You are personally on site, people might not try anything funny anyway.

I wouldn't create two links. It is not a big deal but basically "too complicated". Just put a question on the start of the survey where they mark either A or B and then you base your filters on that and show only the questions for the case they did not have in the first round.

Another options is, that you use a closed survey for second survey. You basically store in the results for survey 1 if they have been A or B. Then you export the data and take their self generated code and the column with A and B and create the token table with this data. You can generate dummy email addresses, etc.

Then you use the selfgenerated code as the token code and A/B is a custom attribute. You can then use this custom attribute (make the survey non-anonymous!!!! you have no personal data in there anyway, so no need for making it anonymous) and then give them the survey link, a field will pop-up for them to insert the token (which is their selfgenerated code) and then Limesurvey already knows based on the token/code if they were A or B and you show/hide the relevant questions.
05 Nov 2026 12:13
Thanks for your reply, here is more background.

Code: Participants create it themselves at the start of each session, on the survey itself (e.g., last letter of their mother’s first name plus their own birthday). I don’t see it and don’t record it. It is only used to link the data of both sessions during analysis.

Invitation: Interested people scan a QR code, give online informed consent and enter their email address (stored separately, no link to the survey data). They are then invited to come to our lab. Both sessions take place at a university laptop in the lab, one week apart, with me present. So participants don’t need to keep any link. In one session they receive a treatment (experimental session), in the other not (control session) (crossover within-subject). This order should be randomized in the first session after T1.

Where the condition comes in: I apply the treatment myself, so I do need to know the condition (A or B) right after T1 in session 1. That is fine for me, because I only know “this person gets A”, not which code belongs to them. Lets say for example If I know ,,A", I can apply treatment and if I know ,,B" I know its the control session.

So I’m thinking of your suggestion with a letter: at the end of session 1 the participant gets a card with A or B (no code on it), and in session 2 I open the survey link for the other condition (two links for everyone, ?Condition=A and ?Condition=B), or the participant selects the letter on the first page. The two surveys are then linked only via the self-generated code.

Does that make sense?

Thanks for your invest in this!
04 Nov 2026 19:10

Every responder gets a unique Code - Is it possible to link this Code to the conditions (A/B) so that the system knows which condition the person had the week before?
It depends. If they get a unique code, then you know who they are basically? You could basically create a token based survey with the token being the unique code and based on that you could show/hide the respective branch of the second survey.

Or, if the unique code is given only after the first survey, you could include something in the unique code that can be interpreted by Limesurvey as the trigger for branch A or branch B.

So I think it would be good to know a little bit more background information.

1. Unique code / self-generated code: Who generates this code, when and how?
2. How do you invite people, how do they get the link to the first survey and how do they get the link to the second survey?
3. Where does the unique / self-generated code into play.

If we understand your proceedure better, we might be able to find a solution.

My concern: You are trying to be as anonymous as possible ("I must not be able to link responses to persons"), fine. But then you want to be able to know what they answered in the first survey / or which branch they went to pass this on to the second one. Without any possibility to connect the two surveys, this is basically impossible.

You could for example give them the a code at the end, either A or B and they need to remember this (note it down) for the next survey. They then choose the respective code at the beginning of the second survey. There is always a risk that they forget about it though. But then they need to remember their unique code in some way.
04 Nov 2026 13:09
Thank you for your reply. This is already very helpful.

Do you think there would be also another option instead of the link that responder need to save.

Every responder gets a unique Code - Is it possible to link this Code to the conditions (A/B) so that the system knows which condition the person had the week before?
04 Nov 2026 12:36 - 04 Nov 2026 12:42
Not sure if I fully understand your needs but what about this?

Two surveys:

In survey 1:
Code:
Condition equation question: {if(rand(0, 1) == 1, "A", "B")}

Say they got option B - they now see this end message

Here is your link to take part in the second survey which will become active on (Date):

Code:
https://yourplatform.com/123456?Condition={Condition}

You could also pass the user generated ID here, so you have a link between survey 1 & survey 2 per respondent

In survey 2, hidden short free question at the start: Condition. This gets prefilled with the condition shown in survey 1. You can now show or hide questions based on this. So if respondent link is Condition B -> show questions related to Condition A for second survey.

The difficult part is that respondents will have to save your link somewhere which isn't ideal.
04 Nov 2026 11:37
Hi all,
I’m planning to run a within-subject crossover study in LimeSurvey. Each participant will complete two sessions one week apart (T0–T3 in each). In session 1, participants are randomized to condition A or B after T1, and I need to see (they need to tell me) the result immediately because I apply the treatment myself. In session 2, they get the other condition, so the system has to know what they received in session 1. The survey is open (no tokens), participants enter a self-generated code, and I must not be able to link responses to persons.
  1. How can I randomize once after T1 and show the result right away?
  2. How can the system remember the condition for session 2, one week later, when many other participants are using the same survey link in between?
  3. How can participants continue in session 2 and automatically get the other condition?
  4. Is “save and resume later” suitable for this without storing email addresses?
  5. Would two separate surveys be more robust for this design?
26 Oct 2026 12:29
Replied by endalk on topic Randomization
Dear Joffm 

Thank you for your excellent reply; it helps me a lot. I will also check what you suggested and follow the guidelines. 

With regards

EKM 
25 Oct 2026 22:13
Replied by Joffm on topic Randomization
Hi,
short answer. Yes, this is possible and more or less the default behaviour.
1. To distribute your respondents just create a random number between 1 and 3 and show the information in G1 only if the random number is equal 2 and the information in G2 only if the random number is equal 3.
To receive an exact equal distribution you will adapt the equation if one or two of the groups are filled.
So you use these functions: rand(x,y), statCountif.
Like:
If G0 is filled: random number from 2 to 3
If G1 is filled: 2*random number from 0 to 1+1 
If G2 is filled: random number from 1 to 2
And if two groups are filled it's trivial, the random number is the remaining group.

Other approaches: 
a. Use a cyclical approach using the response ID, the SAVEDID 
{SAVEDID-3*floor((SAVEDID-1)/3)}
You get: 1,2,3,1,2,3,1,2,3,1,2,3,...

b. use a least filled approach with the function "statCountIf"

2. To select 2 different sets of your 25 sets you may either
  • use a predefined string with 25 characters like 'ABCDEFGHIJKLMNOPQRSTUVWXY'
  • create a random number between 1 and 25
  • store the character at this position
  • remove the character at this position
  • create a random number between 1 and 24
  • store the character at this position

Now you have two different characters that refer to your sets.

And your other questions?
Please, read the manual, create a small test survey, activate it, enter some data and export the results.
Or import one of the sample surveys included in the manual and study them.

If there are more questions, please create a small prototype of the survey and send the lss export.

Joffm

 
25 Oct 2026 17:00
Randomization was created by endalk
Please help us help you and fill where relevant:
LimeSurvey version: [see right hand bottom of your LimeSurvey admin screen]
Own server or LimeSurvey Cloud:
Survey theme/template:
==================Question: Randomly assigning participants to treatment arms and different sets within each arm in LimeSurveyHello LimeSurvey community,I am using LimeSurvey Cloud to run a study with about 450 participants. I would appreciate your advice on whether LimeSurvey can support the randomization and data-recording requirements described below.1. Experimental designEach respondent will be randomly assigned to one of three treatment arms:
  • G0 (Control): do not receive treatment and complete two tasks. First, select four products from a group of 8 products with comparable attributes. In the second task, they do the same thing, but the 8 products are different from the first. 
  • G1: Do the same as the Go or control group, but between the two tasks they receive some information (which is our treatment)
  • G2: Do the same as G1, but in between the two tasks they receive different information (which is our treatment)
All respondents first evaluate eight product groups without information and select four products. After the first choice is recorded, the survey presents the information corresponding to the assigned treatment arm. Respondents then make a second choice based on the presented new products.The study will use 25 product group sets, with eight products in each set. The product set assigned to a respondent must follow the predefined experimental design.2. Questions about randomizationQuestion 1: Random assignment to treatment armsCan LimeSurvey Cloud randomly assign each participant to one of three treatment arms (G0, G1, and G2) when they enter the survey? I plan 450 respondents, with each arm having 150 respondents. Can this assignment be stored in a hidden variable and retained throughout the survey so that the participant sees the correct information at the appropriate stage?Question 2: Assigning product setsCan LimeSurvey randomly assign one of 25 product sets to each participant and store the assigned set ID in a hidden variable?Can the same assigned set ID be retained throughout the survey and used to display the appropriate product groups in both rounds, according to the experimental design?Question 3: Balanced treatment allocationCan LimeSurvey allocate participants approximately equally across the three treatment arms, rather than using independent random draws that might produce unequal group sizes?If exact or near-balanced allocation is possible, how should it be implemented?Question 4: Preventing duplicate or invalid assignmentsCan LimeSurvey prevent a product set from being assigned repeatedly or incorrectly when the design requires restrictions on assignments? For example, products assigned in the first round should not appear in the second round of selection for all arms. Therefore, if product group 5 appears in the first round, for the same respondent it will not appear again, and it will be from the remaining 24 groups. Does LimeSurvey do that? Can assignments be coordinated across participants and survey sessions, rather than being randomized independently for each response?Question 5: Randomization independent of enumeratorParticipants will be recruited from different offices and sectors, and enumerators will administer the survey in the field. Treatment assignment must not depend on the office, sector, or enumerator.Can LimeSurvey randomize treatment arms and resume sets independently of these characteristics? If so, what is the recommended implementation?3. Questions about recording and exporting dataQuestion 6: Recording assignmentsCan the exported response data include, for every participant:
  • Participant or response ID
  • Assigned treatment arm
  • Assigned resume-set ID
  • Candidate IDs displayed in each round
  • Information condition displayed after the first decision
  • First-round and second-round choices
Question 7: Verifying what participants actually sawCan LimeSurvey record not only the assigned treatment and product set, but also which product pages and information screens were actually displayed to each participant?If this requires additional configuration or custom code, what would you recommend?Question 8: Testing the randomization procedureWhat is the recommended way to test the randomization logic before launching the main survey? In particular, how can I verify that assignments remain fixed throughout a participant's session and that the exported data correctly record the assignments?4. Alternative approach: a pre-generated assignment listIf LimeSurvey cannot reliably implement the complete randomization procedure internally, would it be possible to prepare a randomized assignment list in advance and use it to determine each participant's treatment arm and resume set?If so:
  • What is the recommended way to import or link the assignment list to survey participants?
  • Can a unique participant code retrieve the correct assignment?
  • How can the survey prevent an assignment from being reused accidentally?
  • How can we ensure that enumerators cannot choose or change the treatment assignment?
I would prefer to use one centrally managed survey if possible. However, the reliability of the randomization and the ability to verify assignments in the exported data are more important than using a single survey.Thank you very much for your help and suggestions.Best regards
03 Oct 2026 22:31 - 03 Oct 2026 22:32
Hi,
you have to create a random number from 1-3.
Then you show the first message if this random number is equal 1, the second if the number is equal 2.
This is done in the field "condition" of this question.

The same you do with your two manipulation checks.

A random number is created in a question of type "equation". Let's call it "randnum"
In the manual, chapter about "implemented functions", you find the function "rand(x,y)".
To avoid a later change of the generated number (the same behaviour as Excel) we usually use this construct
{if(is_empty(self),rand(1,3),self)}
About the variable "self" please read the manual.

Now you enter in the "condition" of the first message randnum==1, and in the second randnum==2

If there are further questions about this, please send the lss Export of the survey.

Joffm

BTW: Why didn't you answer the questions that appeared at the beginning?
03 Oct 2026 15:37
Please help us help you and fill where relevant:
Your LimeSurvey version: [see right hand bottom of your LimeSurvey admin screen]
Own server or LimeSurvey hosting:
Survey theme/template:
==================Hello team,

I would like to conduct a survey using LimeSurvey.The study concerns news framing effects. For this reason, two experimental conditions have been designed, in which participants will be exposed to a message about the European Union at the beginning of the questionnaire. There is also a control group, in which participants will not be asked to read any message. Each participant will answer only one questionnaire. Therefore, there are three different questionnaires: two questionnaires that include a message at the beginning, and one control-group questionnaire without a message at the beginning. The message at the beginning is the only difference between the two questionnaires. Everything else is identical. The control group includes exactly the same questions as the other two groups, except for two manipulation-check questions included in the two treatment conditions.My question is how random allocation of participants to one of the three conditions can be implemented in LimeSurvey.Thank you very much in advance for your time and assistance.Kind regards,
Evangelos Theodorou
Displaying 1 - 15 out of 234 results.

Lime-years ahead

Online-surveys for every purse and purpose