Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:
  • Seite:
  • 1
  • 2

THEMA: Generate Unique PIN for user

Generate Unique PIN for user 2 Jahre 11 Monate her #80502

  • mkb
  • mkbs Avatar
  • OFFLINE
  • Junior Lime
  • Beiträge: 24
  • Dank erhalten: 1
  • Karma: 0
Hi,
Trying to find the best way to do this:

I have a survey where the people taking it need to be anonymous (for their company info). It is possible that the person would like to get more information on their own after the survey. I thought that I could generate a unique PIN number that would show at the beginning of the survey with text telling them to remember this number for future use..yadda yadda. That way if they do want more info, they can tell us the number and we can just pull out their answers. The way this survey works..they cannot do it twice.

I cannot use token/emails..because the user would think their answers could be tracked back to them...also multiple users could be taking the survey on one computer at work..so IP wont give them away.

I read about insertrans, savedid, etc...not sure if what I want to do would apply.

Any help will be greatly appreciated,
Marilyn
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Generate Unique PIN for user 2 Jahre 10 Monate her #81454

  • ricopoco
  • ricopocos Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 6
  • Karma: 0
Ditto. I need this option as well. We are collecting anonymous research data in a university setting. Ethics requirements call for us to be able to remove a participant's at their request. We'd like to give each participant a unique PIN at the outset so that if they contact us, we can identify their data set.

So, if this is doable, I too would greatly appreciate the info. Thanks much.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Generate Unique PIN for user 2 Jahre 10 Monate her #81457

  • mkb
  • mkbs Avatar
  • OFFLINE
  • Junior Lime
  • Beiträge: 24
  • Dank erhalten: 1
  • Karma: 0
Hi, Sorry I have been so busy lately I should have came back here and explained how I got this to work.

Just use: SAVEDID

It is my understanding that you have to have a question answered before it will show the number....so I just had a survey agreement where they click yes before they take the survey. I also placed it at the end of the survey as a reminder.

i.e. Please remember this number if you would like to discuss your individual results: SAVEDID (which will show the unique ID number).

I am not sure but I think I remember that the survey needs to be Active/Live before you will see the actual number.

My survey is now live and it is working just fine.

Hope this helps,
Marilyn
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Folgende Benutzer bedankten sich: ricopoco

Re: Generate Unique PIN for user 2 Jahre 10 Monate her #81489

  • ricopoco
  • ricopocos Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 6
  • Karma: 0
Sounds like it will do exactly what I need it to do -- I'll play with that. Thank-you for sharing!
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Generate Unique PIN for user 2 Jahre 10 Monate her #81528

  • Mazi
  • Mazis Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 5601
  • Dank erhalten: 320
  • Karma: 255
mkb schrieb:
Hi, Sorry I have been so busy lately I should have came back here and explained how I got this to work.

Just use: SAVEDID

It is my understanding that you have to have a question answered before it will show the number....so I just had a survey agreement where they click yes before they take the survey. I also placed it at the end of the survey as a reminder.

i.e. Please remember this number if you would like to discuss your individual results: SAVEDID (which will show the unique ID number).

I am not sure but I think I remember that the survey needs to be Active/Live before you will see the actual number.

My survey is now live and it is working just fine.

Hope this helps,
Marilyn
Marilyn,
you are right at each point. The SAVEDID is the unique ID for each data set at the lime_survey_12345 table and it is only available for activated surveys AND you need to have clicked "next" at least once to store partial survey data and get such an ID assigned.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Generate Unique PIN for user 2 Jahre 10 Monate her #81530

  • floccs
  • floccss Avatar
  • OFFLINE
  • Senior Lime
  • Beiträge: 47
  • Dank erhalten: 5
  • Karma: 2
You can also use a workaround I've created.
Anonymously track respondents answers across multiple surveys
This allow to track participants without the need to remember any ID.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Generate Unique PIN for user 2 Jahre 10 Monate her #81534

  • ricopoco
  • ricopocos Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 6
  • Karma: 0
Snooping around, it looks like SAVEDID is simply seqentiall numbers. I need something that would provicde IDs that are not easily be guessed. I'm going to try using a hidden question with the label "PIN" and the default answer to something like {time()*rand()}. Then I'll use INSERTANS to provide the PIN to the respondent. I'll post the details when I've worked them out and run some tests.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Generate Unique PIN for user 2 Jahre 10 Monate her #81536

  • TMSWhite
  • TMSWhites Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 759
  • Dank erhalten: 82
  • Karma: 36
ricopoco schrieb:
Snooping around, it looks like SAVEDID is simply seqentiall numbers. I need something that would provicde IDs that are not easily be guessed. I'm going to try using a hidden question with the label "PIN" and the default answer to something like {time()*rand()}. Then I'll use INSERTANS to provide the PIN to the respondent. I'll post the details when I've worked them out and run some tests.

There is an example like that here. Create an Equation-type question, named PIN, and put this code in it:
{if(!is_empty(PIN),PIN,time()*rand())}

That will ensure that PIN only gets generated once (instead of once per page visit and validation).
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Folgende Benutzer bedankten sich: qsgt

Re: Generate Unique PIN for user 5 Monate 1 Woche her #114190

  • holch
  • holchs Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 3360
  • Dank erhalten: 455
  • Karma: 145
Sounds good, but isn't there a slight chance that there could be duplicates like this?

I know that the chances is relatively small considering that you use the time stamp multiplied by a random number. But still there is a chance, right?

Rand would create a number from 0-9, right?
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Generate Unique PIN for user 5 Monate 1 Woche her #114191

  • Ben_V
  • Ben_Vs Avatar
  • OFFLINE
  • Platinum Lime
  • Beiträge: 1292
  • Dank erhalten: 303
  • Karma: 86
holch schrieb:
Rand would create a number from 0-9, right?

Using {rand()} expression, I've always seen a quiet big 8, 9 or 10 digits number.
You can set some range precision with the following format :
{rand(99, 499)}

Related: Chance.js: Utility library to generate anything random for JavaScript
Benoît

goo.gl/Bw5iM => Recherche GG dans le forum français (remplacer "exemple" dans la barre de recherche)
goo.gl/WX8PH => GG search for english forum (Replace "example" in the search bar)
goo.gl/IxiGu => Búsqueda en el foro en español (Cambiar "ejemplo" en la barra de...
Der Administrator hat öffentliche Schreibrechte deaktiviert.
  • Seite:
  • 1
  • 2
Moderatoren: ITEd
Ladezeit der Seite: 0.218 Sekunden
Donation Image