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

Plus d'informations
il y a 1 mois 1 semaine - il y a 1 mois 1 semaine #173686 par RitaShen
RitaShen a créé le sujet : 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
Dernière édition: il y a 1 mois 1 semaine par RitaShen.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 1 semaine #173688 par jelo
jelo a répondu au sujet : 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

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 1 semaine #173690 par RitaShen
RitaShen a répondu au sujet : 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

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 1 semaine #173715 par DB1324
DB1324 a répondu au sujet : 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.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 1 semaine #173716 par jelo
jelo a répondu au sujet : 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

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 1 semaine #173717 par holch
holch a répondu au sujet : 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

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 1 semaine #173730 par Joffm
Joffm a répondu au sujet : 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

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 1 semaine #173813 par Joffm
Joffm a répondu au sujet : 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
Pièces jointes :
Les utilisateur(s) suivant ont remercié: tpartner

Connexion ou Créer un compte pour participer à la conversation.

Commencez dès maintenant !

Créez simplement un compte et commencez à utiliser LimeSurvey dès aujourd'hui.

Inscrivez-vous maintenant

Inscrivez-vous à notre Newsletter!