Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Unique code verification

More
8 years 2 months ago #129900 by yam
Unique code verification was created by yam
I have LimeSurvey version 2.06+ Build 151 215 which runs on XAMPP

Step 1. Participants will begin the survey by entering a predetermined unique code that is written on a form.
Thereafter, the same code is to be entered again and compared with the first, to make sure no misspelling has occurred from paper. If the codes are different, the error message is displayed and the first question is to be asked again.

Step 2. If the two entered codes match, it shall be a lookup in a database to verify that the code is there, which ensures that there is a code that is printed on a form (an actual existing code).
If the code is found, the survey should start, otherwise, the error message is displayed and the first question to be asked again (asking for entering the code).

I would like help with:
How to create questions that controls the two inputs for the code? (step 1.)
How do solve lookups in the database (to verify that the code exists)? (step 2.)

Should I use tokens to solve step 2. above?

The code should be visible to the user when entered in the field.

I am a novice at Limesurvey so I need help, how to code and where everything need to be inserted.

The database is created in MySQL and filled with data from an Excel file with over 10,000 lines.

CREATE DATABASE `id_no`
CREATE TABLE `id` (
`recno` int(11) NOT NULL,
`id_no` varchar(15) NOT NULL,
PRIMARY KEY (`id_no`),
UNIQUE KEY `idx_id_id_no` (`id_no`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 2 months ago #129906 by holch
Replied by holch on topic Unique code verification
I think you could use tokens for this to make things easier.

Half of what you need is already there: checking if the code exists in the database.

Then you just need an additional question to ask for the code again. Then you can check via Expression Manager if the answer to the question is the same as the token.

Tokens are usually sent via email, but you can also create a CSV file with the codes and print them and not send the via email, but distribute them in any other way. If a respondent accesses the link of a token based survey without the token in the URL (which is usually the case with the email invitation), then Limesurvey asks for the token. So this is one step. Then the next question for entering the code again and you check with EM if the token is the same as the answer to the first question. You probably have to finish the survey there with a quota. Not sure if you can base quotas on expression type questions. You would need to research/test this.

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.

Lime-years ahead

Online-surveys for every purse and purpose