- Posts: 3
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Random number in anonymous survey
- leviathan
- Topic Author
- Offline
- New Member
Less
More
7 years 4 months ago #144584
by leviathan
Random number in anonymous survey was created by leviathan
I am setting up an anonymous survey. I want to give some prize to random respondent after filling the survey and need a random number generated from set of numbers (eg. 1000 - 2000). Problem is that one number should only generated once. Is there this kind addons available or similar achievement or do i have to made it by myself?
Plan:
Recipients answers questions anonymously
Random number is printed in the last page of survey with text "Please, come to us and check if you win some prize. Your lucky number is: xxxxxxxx".
Plan:
Recipients answers questions anonymously
Random number is printed in the last page of survey with text "Please, come to us and check if you win some prize. Your lucky number is: xxxxxxxx".
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3690
7 years 4 months ago #144607
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Random number in anonymous survey
You'll have to code that yourself - there is no access to previous results from within a survey.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- leviathan
- Topic Author
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
7 years 4 months ago #144615
by leviathan
Replied by leviathan on topic Random number in anonymous survey
Actually i don't need any previous results. I need one unique number witch is related to answerer.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3690
7 years 4 months ago #144616
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Random number in anonymous survey
Yes, you do need previous results to find which random numbers have already been assigned.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11746
- Thank you received: 2750
7 years 4 months ago #144617
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Random number in anonymous survey
How about this: you create a random number. Any random number, and add it to the SID. You would need to make sure that the SID has a certain length, so maybe you have to add some digits, but I guess this would serve the purpose and still be fairly simple.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
- Ben_V
- Offline
- Platinum Member
Less
More
- Posts: 1223
- Thank you received: 351
7 years 4 months ago - 7 years 4 months ago #144621
by Ben_V
Benoît
EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Replied by Ben_V on topic Random number in anonymous survey
as proposed by @Holch something compose around:
{rand(min, max)}{SAVEDID}
=> Generate code at the end of survey
=> Generate Unique PIN for user
{rand(min, max)}{SAVEDID}
=> Generate code at the end of survey
=> Generate Unique PIN for user
Benoît
EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Last edit: 7 years 4 months ago by Ben_V.
The topic has been locked.
- LouisGac
- Visitor
7 years 4 months ago - 7 years 4 months ago #144633
by LouisGac
Replied by LouisGac on topic Random number in anonymous survey
Last edit: 7 years 4 months ago by LouisGac.
The topic has been locked.
- leviathan
- Topic Author
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
7 years 3 months ago #145024
by leviathan
Replied by leviathan on topic Random number in anonymous survey
Thank you!
I think that solution is suitable for me.
I think that solution is suitable for me.
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11746
- Thank you received: 2750
7 years 3 months ago #145061
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Random number in anonymous survey
I hope it is not the one from Louis...
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.