Welcome, Guest
Username: Password: Remember me

TOPIC: Randomized {SAVEDID}?

Randomized {SAVEDID}? 2 years 7 months ago #78277

  • Ralle
  • Ralle's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 10
  • Karma: 0
Hi guys,

As far as I understood, the participant ID which I can access via the {SAVEDID} code, is just a mere counter starting at 1.
I would like to have an ID printed to the participant at the end of the survey to enable them to delete the record later and access their results (in a different system not connected to LimeSurvey). So I thought that using the SAVEDID was the easiest way to go as it is already generated and bound to that particular run of the survey.
But I sure can not use it as long as it just counts up, as that basically would open the results of anyone to everyone. Is there a way to randomize the SAVEDID?

Thanks for your answer :)
Ralle
The administrator has disabled public write access.

Re: Randomized {SAVEDID}? 2 years 7 months ago #78280

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6561
  • Thank you received: 871
  • Karma: 257
Hello,

Seems difficult to change a id (AUTO_INCREMENT).

Maybe the best is to use token. Token is randimzed, token is unique. You can have some php script to have token generated at end of survey (use autoload url).

Another way is to use "hidden" question type, with Prefilling survey answers using the survey URL

Lot of way to do without changing {SAVEDID} and LS core.

Denis
The administrator has disabled public write access.

Aw: Randomized {SAVEDID}? 2 years 7 months ago #78282

  • Ralle
  • Ralle's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 10
  • Karma: 0
Thanks for your input!
It pointed me to the "right" direction.

What I ended up doing:
I used the PHP script from here to generate my own ID and bind it to a newly generated hidden question at the beginning of my survey. Make sure to always call the new script now instead of index.php directly.
Then I used the "answer" (the user can not easily change it itself because it is hidden) to show the ID in the endpage (beware of this bug [in German], you currently have to allow printing). I inserted the following to end text (text elements setting of the survey itself):
{SAVEDID}{INSERTANS:91125X125X7898}

Make sure to select the correct SGQA code and also beware of it changing when you copy the survey to test it (no way around that I think when using the extra PHP script).

Good luck with it! :)
Ralle
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.161 seconds
Donation Image