u/Fabulous-Guard-6974

LimeSurvey random number seems to change on export

Hi everyone,

I’m dealing with a strange issue in LimeSurvey related to randomization and conditions, and I’d really appreciate some insight.

In my survey, I assign participants to conditions using:

- {rand(1,2)} to generate a random number

- (condition == 1) and **(**condition == 2) to display the corresponding blocks

During the survey, everything appears to work correctly: participants see the right condition and answer accordingly.

However, when I export the data, the value stored for the random number sometimes doesn’t match the condition the participant actually saw. I tested it myself: I noted the condition I was assigned during the survey, but in the exported dataset the number is different, as if LimeSurvey generated a new random number instead of saving the original one.

What makes this even more confusing is that the issue is not consistent.

Some participants have the correct random number in the export, and they also pass all attention checks. Others show a mismatch.

Since the survey is already active and collecting data, I would strongly prefer a solution that allows me to fix the issue by changing only the code, without restructuring the survey or restarting data collection.

My main question is:

Is there a reliable way to store the random number as a fixed value (e.g., via an equation question or hidden field) so that {rand(1,2)} doesn’t get recalculated later?

Any suggestions or best practices would be extremely helpful. I need to analyze condition-wise data, but right now the exported values aren’t always trustworthy.

Thanks in advance!

reddit.com
u/Fabulous-Guard-6974 — 6 days ago

LimeSurvey random number seems to change on export

Hi everyone,

I’m dealing with a strange issue in LimeSurvey related to randomization and conditions, and I’d really appreciate some insight.

In my survey, I assign participants to conditions using:

- {rand(1,2)} to generate a random number

- (condition == 1) and (condition == 2) to display the corresponding blocks

During the survey, everything appears to work correctly: participants see the right condition and answer accordingly.

However, when I export the data, the value stored for the random number sometimes doesn’t match the condition the participant actually saw. I tested it myself: I noted the condition I was assigned during the survey, but in the exported dataset the number is different, as if LimeSurvey generated a new random number instead of saving the original one.

What makes this even more confusing is that the issue is not consistent.

Some participants have the correct random number in the export, and they also pass all attention checks. Others show a mismatch.

Since the survey is already active and collecting data, I would strongly prefer a solution that allows me to fix the issue by changing only the code, without restructuring the survey or restarting data collection.

My main question is:

Is there a reliable way to store the random number as a fixed value (e.g., via an equation question or hidden field) so that {rand(1,2)} doesn’t get recalculated later?

Any suggestions or best practices would be extremely helpful. I need to analyze condition-wise data, but right now the exported values aren’t always trustworthy.

Thanks in advance!

reddit.com
u/Fabulous-Guard-6974 — 6 days ago

LimeSurvey random number seems to change on export

Hi everyone,

I’m dealing with a strange issue in LimeSurvey related to randomization and conditions, and I’d really appreciate some insight.

In my survey, I assign participants to conditions using:

- {rand(1,2)} to generate a random number

- (condition == 1) and (condition == 2) to display the corresponding blocks

During the survey, everything appears to work correctly: participants see the right condition and answer accordingly.

However, when I export the data, the value stored for the random number sometimes doesn’t match the condition the participant actually saw. I tested it myself: I noted the condition I was assigned during the survey, but in the exported dataset the number is different, as if LimeSurvey generated a new random number instead of saving the original one.

What makes this even more confusing is that the issue is not consistent.

Some participants have the correct random number in the export, and they also pass all attention checks. Others show a mismatch.

Since the survey is already active and collecting data, I would strongly prefer a solution that allows me to fix the issue by changing only the code, without restructuring the survey or restarting data collection.

My main question is:

Is there a reliable way to store the random number as a fixed value (e.g., via an equation question or hidden field) so that {rand(1,2)} doesn’t get recalculated later?

Any suggestions or best practices would be extremely helpful. I need to analyze condition-wise data, but right now the exported values aren’t always trustworthy.

Thanks in advance!

reddit.com
u/Fabulous-Guard-6974 — 6 days ago

LimeSurvey random number seems to change on export

Hi everyone,

I’m dealing with a strange issue in LimeSurvey related to randomization and conditions, and I’d really appreciate some insight.

In my survey, I assign participants to conditions using:

- {rand(1,2)} to generate a random number

- (condition == 1) and (condition == 2) to display the corresponding blocks

During the survey, everything appears to work correctly: participants see the right condition and answer accordingly.

However, when I export the data, the value stored for the random number sometimes doesn’t match the condition the participant actually saw. I tested it myself: I noted the condition I was assigned during the survey, but in the exported dataset the number is different, as if LimeSurvey generated a new random number instead of saving the original one.

What makes this even more confusing is that the issue is not consistent.

Some participants have the correct random number in the export, and they also pass all attention checks. Others show a mismatch.

Since the survey is already active and collecting data, I would strongly prefer a solution that allows me to fix the issue by changing only the code, without restructuring the survey or restarting data collection.

My main question is:

Is there a reliable way to store the random number as a fixed value (e.g., via an equation question or hidden field) so that {rand(1,2)} doesn’t get recalculated later?

Any suggestions or best practices would be extremely helpful. I need to analyze condition-wise data, but right now the exported values aren’t always trustworthy.

Thanks in advance!

reddit.com
u/Fabulous-Guard-6974 — 6 days ago
▲ 3 r/SurveyExchange+2 crossposts

[Academic] Help me graduate before my thesis supervisor deletes me from existence (15-minute survey)

Hi everyone,

I’m currently fighting for my academic survival and desperately looking for participants for my thesis survey 😭

My research explores how memory influences the perception of different social groups after watching a commercial. It only takes about 15 minutes, it’s completely anonymous and you’d genuinely be saving my degree (and possibly my mental stability).

Perfect activity for when you’re procrastinating, avoiding work or pretending to listen during an online lecture.

Survey link: https://forms.gle/C1N21ggDLkDXK6hh8

I’ll happily complete your survey in return if you leave it in the comments!

Thanks to anyone who helps: future me owes you one 🫶

u/Fabulous-Guard-6974 — 6 days ago

[Academic] Help me graduate before my thesis supervisor deletes me from existence (15-minute survey)

Hi everyone,

I’m currently fighting for my academic survival and desperately looking for participants for my thesis survey 😭

My research explores how memory influences the perception of different social groups after watching a commercial. It only takes about 15 minutes, it’s completely anonymous and you’d genuinely be saving my degree (and possibly my mental stability).

Perfect activity for when you’re procrastinating, avoiding work or pretending to listen during an online lecture.

Survey link: https://forms.gle/C1N21ggDLkDXK6hh8

I’ll happily complete your survey in return if you leave it in the comments!

Thanks to anyone who helps or upvotes for visibility: future me owes you one 🫶

reddit.com
u/Fabulous-Guard-6974 — 14 days ago

[Academic] Help me graduate before my thesis supervisor deletes me from existence (15-minute survey)

Hi everyone,

I’m currently fighting for my academic survival and desperately looking for participants for my thesis survey 😭

My research explores how memory influences the perception of different social groups after watching a commercial. It only takes about 15 minutes, it’s completely anonymous and you’d genuinely be saving my degree (and possibly my mental stability).

Perfect activity for when you’re procrastinating, avoiding work or pretending to listen during an online lecture.

Survey link: https://forms.gle/C1N21ggDLkDXK6hh8

I’ll happily complete your survey in return if you leave it in the comments!

Thanks to anyone who helps or upvotes for visibility: future me owes you one 🫶

reddit.com
u/Fabulous-Guard-6974 — 14 days ago