How to create a custom PIN number on End Message/question

Mehr
2 Wochen 11 Stunden her - 2 Wochen 11 Stunden her #173686 von RitaShen
RitaShen erstellte das Thema How to create a custom PIN number on End Message/question
Hi there,

I have a question type, but I have no idea does it can work on LimeSurvey.

How to create a custom PIN number on End Message or in the question, each respondents will see their own unique PIN number. 100 respondents will have 100 unique PIN number.

how could I do this on the limesurvey?

Many thanks
Rita
Letzte Änderung: 2 Wochen 11 Stunden her von RitaShen.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Wochen 8 Stunden her #173688 von jelo
jelo antwortete auf das Thema: How to create a custom PIN number on End Message/question
What purpose has the PIN?
What format is needed?

You could use the respondent ID {SAVEID} and combine that ID (which is too easy to guess when used as PIN) with randomnumbers.

Are you a student conducting a survey? If yes, tell me why you use LimeSurvey?
www.limesurvey.org/forum/development/116...y-you-use-limesurvey

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Wochen 8 Stunden her #173690 von RitaShen
RitaShen antwortete auf das Thema: How to create a custom PIN number on End Message/question
it's the coupon PIN
every one will have specify PIN number
they can use this PIN number to buy something.
as the Respondents finish the survey, they can will see their own PIN number on the END PAGE or in next page.

e.g.
Respondent A will see this PIN number : G12A35
Respondent B will see this PIN number : Z1553w
Respondent C will see this PIN number : O82aw7

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Wochen 2 Stunden her #173715 von DB1324
DB1324 antwortete auf das Thema: How to create a custom PIN number on End Message/question
I'm looking to do the exact same thing - we use multiple systems, and want to generate a not-immediately-predictable PIN to be entered into our other programmes to ensure participant records aren't mixed up.

RitaShen - I would be interested to hear if you are successful with this.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Wochen 2 Stunden her #173716 von jelo
jelo antwortete auf das Thema: How to create a custom PIN number on End Message/question
If respondent get the URL with a token, you can create the PIN as an additional attribute and assign a unpredictable PIN to every token.
Since the PIN should be check in other systems, when respondents enter them, you can work with precreated PINs.

Are you a student conducting a survey? If yes, tell me why you use LimeSurvey?
www.limesurvey.org/forum/development/116...y-you-use-limesurvey

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Wochen 1 Stunde her #173717 von holch
holch antwortete auf das Thema: How to create a custom PIN number on End Message/question
I think the most important question is:

Can the PIN be created any way you want or do you need to use predefined PINs. Approaches need to be different for both options, I guess.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
1 Woche 6 Tage her #173730 von Joffm
Joffm antwortete auf das Thema: How to create a custom PIN number on End Message/question
Hi,.
If there is a predefined list of numbers, you may use an ajax call to select one.
I am not sure if I provided an example a few weeks ago.
Anyway, I will do it on Thursday when I am back home.
Joffm


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

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
1 Woche 5 Tage her #173813 von Joffm
Joffm antwortete auf das Thema: How to create a custom PIN number on End Message/question
Hi,
here the promised example:
In my survey I have a hidden question of type "short text" with this javascript to do the ajax call:
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:scriptcomplete',function(){
       $.post('https://www.myServerr.com/myFolder/getCode.php',function(data) {
 
                   $('#question{QID} input[type="text"]').val(data)
 
	});
        $('#question{QID}').hide();
);
</script>

In my database I created a table "voucher" with three fields:
1. id (autoincrement)
2. vouchercode (varchar(20))
3. status (Tinyint) This as flag, if the code was already used


And now the php file "getCode.php"
(only as example, depends on your way of connecting and library (mysqli, PDO, ...)
1. Connect to the database
2. query the table:
"SELECT vouchercode from voucher WHERE status=0 limit 1" (So you get always only one row with the first not used vouchercode)
3, Save the vouchercode to $myCode=
4. Update the table; set the status of this vouchercode to "used" =1)
"UPDATE voucher SET status=1 WHERE vouchercode=$myCode";

5. echo the vouchercode
echo $myCode;


which is really the next one in the database.

Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Anhang:
Folgende Benutzer bedankten sich: tpartner

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten

Abonnieren Sie unseren Newsletter

Abonnieren Sie unseren Newsletter für alle Neuigkeiten rund um LimeSurvey
captcha