I have a list of gift card codes that I want to distribute to my survey participants. If they make it to the end of the survey, they will receive a code. Can I upload/import the codes to LimeSurvey in order to do this?
if you use tokens you can use ATTRIBUTEs to provide a code.
Then each respondent will get a predefined code.
If you don't use tokens, or if you want to provide random codes, you can:
create a question of type huge free text,
enter all codes in a well defined format as "default answers", e.g. QW12ER BG5RTZ 45DFRE.
You see each code starts at a multiple of 7 and is 6 characters long.
create a random number (rn) between 1 and the total number of codes
with functions like "substr" select the respective code like "mycode=substr((rn-1)*7,6)".
If there are further question don't hesitate to ask
Best regards
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
OK! If I don't have a predefined list of participants, can I still assign tokens and attributes to the participants? Ex. each participant who clicks the URL is assigned a token that can be used to index into a gift code.
I think the only solution is to create a plugin for such system
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. -
Professional support
-
Plugins, theme and development
. I don't answer to private message.
Oh I see. I thought I would be able to upload the gift code file and dynamically retrieve a new code every time that someone finished the survey. Maybe that is asking too much.
You would have to program this yourself. This is not part of LS out of the box. You can create a little php (or whatever script), that is called by the end url feature.
But the token approach would be of course the best way.
Those gift vouchers have predefined codes or could you generate those codes yourself?
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
I like your idea of retrieving codes by index but have two worries:
1. Someone could inspect the source code and copy all the query codes.
2. I would need to manually update the codes every time that the participant count hit the limit (e.g. 100 codes only last for 100 participants).
The best solution is the token method but I won't be able to pre-determine who my participants will be, which means that I can't assign them tokens.
Great, thanks. I'll look into php scripts to handle this.
To answer your question, the codes are predefined which is why I wanted to upload a single file containing all the codes. You can generate them using an API but it's a bit complicated.