Welcome to the LimeSurvey Community Forum

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

Generate random Code at End of 1st Survey - zufällig generierter Code

  • Sandara
  • Sandara's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 2 months ago #239967 by Sandara
Please help us help you and fill where relevant:
Your LimeSurvey version: LimeSurvey Cloud, Version 5.6.3
Own server or LimeSurvey hosting: I think the latter
Survey theme/template: Default Survey Group
==================
I have a question, I am a complete newbie and want to know whether I can link two (very similar bot not completely identical) surveys (1st: baseline & 2nd: 3 months later). Is it possible to generate a random code (8 digits) at the end of the first survey that then serves as an identification for the 2nd survey (to be able to link the two datasets and compare them)?

And if yes, how do I do that? Is there any default option that I can choose? 

Thank you for your help!

GERMAN:
Ich habe eine Frage, ich bin ein absoluter Neuling und möchte wissen, ob ich zwei (sehr ähnliche, aber nicht völlig identische) Umfragen (1.: Baseline & 2.: drei Monate später) miteinander verknüpfen kann. Ist es möglich, einen Zufallscode (8 Ziffern) zu generieren, der dann als Identifikation für die 2. Erhebung dient (um die beiden Datensätze miteinander verknüpfen zu können)?

Und wenn ja, wie kann ich das tun? Gibt es eine Standardoption, die ich wählen kann? 

Danke für Eure Hilfe!

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 2 months ago #239968 by holch
Well, this has been answered in the past here in the forum, there are quite a few examples of how to generate random codes, etc.

However, please keep in mind that random codes are a recepy for being forgotten. What do you want the random code to be used for? Should peole note it down and then put it into the next survey in 3 months? Good luck...

How do you invite people to your survey? How do they get the link for the first survey? How do they get the link for the second survey 3 months later?

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: Sandara

Please Log in to join the conversation.

  • Sandara
  • Sandara's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 2 months ago #239970 by Sandara
Hi, thank you for your answer!

1. Do you know what search term I could use? Because I could not find what I needed in the forum! But I might just not be using the correct terms...

2. Yes, I am aware of that problem... But it is the only way we (my supervisor and I) could think of to maintain anonymity AND to make sure at the same time that the participant has completed BOTH surveys. This is important because the incentive that we are giving only applies if they completed both surveys. The idea behind it is: if the incentive (winning a laptop) is high enough, they will want to store the code safely (they will also be reminded of this in a message at the end, also with a suggestions to store it with important documents to not lose it.) But probably it still isn't enough... We will see, I guess!

3. The second reason why we thought about this code (that is later put in the second survey) is that it links the two datasets and makes it possible to compare the two timelines. I hope I could explain properly what I mean ^^

4. The invitation and re-invitation is being taken care of by another institution.

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 2 months ago - 1 year 2 months ago #239972 by holch

1. Do you know what search term I could use? Because I could not find what I needed in the forum! But I might just not be using the correct terms...

duckduckgo.com/?q=limesurvey+generate+random+code&ia=web

2. Yes, I am aware of that problem... But it is the only way we (my supervisor and I) could think of to maintain anonymity AND to make sure at the same time that the participant has completed BOTH surveys. This is important because the incentive that we are giving only applies if they completed both surveys. The idea behind it is: if the incentive (winning a laptop) is high enough, they will want to store the code safely (they will also be reminded of this in a message at the end, also with a suggestions to store it with important documents to not lose it.) But probably it still isn't enough... We will see, I guess!

Winning something might be motivating enough, but we know how that goes, people often forget things, don't find it anymore, etc.

3. The second reason why we thought about this code (that is later put in the second survey) is that it links the two datasets and makes it possible to compare the two timelines. I hope I could explain properly what I mean ^^


That became pretty clear, but same problem as above. People forget, especially over a longer period of time. This is why I would suggest different approaches that reduce the risk of "losing" or "forgetting" the random code.

4. The invitation and re-invitation is being taken care of by another institution.

 


Now if the invitation and re-invitation is taken care of by another institution, you already have a fairly good separation between personal date (take care of by the other institution) and survey data.

In this case (of course it depends how the other instituation invites people - which is why I asked about the invitation process) I would generate token based surveys. You can then create individual links / tokens and you can use the same tokens for both surveys. You just need to make sure that the other instituation gives the same token to the person for the second survey than for the first survey. This could also help to remind participants about their participation.

As you don't have any contact data for the respondent it would provide the same anonymity than to generate a random code at the end that the person will need to remember / find after 3 months.

I think chances are better that the other instituation sends the correct token / link to the respondents from the first wave. Only downside to this approach is, that the other instituation would know who took part in the first survey, as for the second survey you would probably only provide them with tokens of those that had participated in the first wave. But actually, for the price draw you would still at least provide the token / code of the winner to the other instituation.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

Last edit: 1 year 2 months ago by holch.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 2 months ago - 1 year 2 months ago #239973 by Joffm
Well, only to generate a random, unique code is a very easy thing.
1. Use the SAVEDID of the first survey. So you get the unique part.
Then create a random code, either just numerical, like rand (111111,999999) or with some string operations a code of characters.
This random number is not 100% unique  There might be / will be duplicates.
Therfore you add the SAVEDID.
Though the random number may be equal for two participants, like 213567, by adding the SAVEDID (left padded to 4 characters)  it is unique, like 2135670213  and 2135674765.

Or you use something the respondent knows, easier to memorize.
Combine "first two characters of your mother's first name", "last two characters of your father's first name" or whatver you may think of, and the left padded SAVEDID.
You will get something like "BE0314ER" or "ST1023RL". 

Just use your imagination.
It is up to you how you generate this.

----
Und im deutschen Teil gibt es diese Frage mindestens fünfmal in den letzten zwei Jahren.
Hättest Du dort gefragt, ...

Joffm
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 year 2 months ago by Joffm.

Please Log in to join the conversation.

  • Sandara
  • Sandara's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 2 months ago #240161 by Sandara
Hi,

thank you for your answer! Where do I find the the SAVEDID and where should I put it? Is there anywhere where I can find the code for this? And if I find it, where should I put the code? Would I just create another question group and then "add another question"? But how would it give me (or the participant) an output? I only know those questions in which you can actually write an answer as a participant... Not one that generates a text/answer/number that changes from participant to participant... Do you know what I mean?

Im deutschen Forum habe ich unter dem Suchbegriff "zufällig generierter Code" keinen einzigen Eintrag gefunden! Wäre es möglich mir entweder den richtigen Suchbegriff zu nennen oder vielleicht einen der Beiträge hier zu verlinken hier? Damit wäre mir sehr geholfen! Herzlichen Dank!

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 2 months ago #240164 by holch
The can be accessed with {SAVEDID} it is unique for each started response in a survey.

There is the equation question type where you can make calculations and generate random numbers, just like described in the forum a million times.

Joffm has a couple of tutorials that explain a lot of stuff. If you search for "joffm tutorial" or something you should find them.

I don't have the time now to do the search for you or to find the right search terms. I actually would always use an extern search engine to find things in the forum, not the forum search. But that is up to you. I have already given you a search result with link in one of my answers.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 2 months ago #240165 by Joffm
SAVEDID is a system placeholder that is accessed by {SAVEDID}
You have to create a question of type equation where you calculate - and store - your random code

Now, read the manual about ExpressionScript
[url] manual.limesurvey.org/ExpressionScript_-_Presentation/en [/url]
study the sample surveys
[url] manual.limesurvey.org/ExpressionScript_sample_surveys/en [/url]

Or have a look at the many Youtube videos of our partner Paul Borsdorf 
e.g. there is one called "Berechnungen durchführen", though he uses a question of type "text display" to show the result. As said, you have to use an equation.

Joffm




 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 2 months ago #240176 by Joffm
And you may read my tutorial 4: "Gleichungen, Zu- und andere Fälle", that you find in the German section.
Chapter 1.3.1.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose