Automatically adding participants to a survey

More
2 months 3 days ago #236296 by labean0103
LimeSurvey version: 3.25.18+210316
==================
Hello!

I would like to know if it is possible to automatically create participants info based on the user input/answers to another survey? So, basically it would look like there is a survey, and when a person opens that survey, puts name and other info into that survey and submits it, that automatically creates a participant into another survey with the name information given by that user. I am good with programming, but not a pro, so I am a little bit confused about how I could do that and is it even possible, so any information would be useful, thanks!

Please Log in to join the conversation.

More
2 months 3 days ago #236297 by holch
I see two options for you:

Allow public registration for a closed survey with tokens:
manual.limesurvey.org/Participant_settin..._public_registration

Or you create your own script that generates users with a token via the API:
manual.limesurvey.org/RemoteControl_2_API

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The following user(s) said Thank You: labean0103

Please Log in to join the conversation.

More
2 months 3 days ago #236299 by tammo
You could do the following: if and when the respondent answers the questions in a way that will qualify him or her for a follow up survey, you can generate a random code (save that in Survey 1) and use that random code as a pass over variable to the following survey (Survey 2, URL in the end message, load immediately). If not, the end message can be: "Thank you" of a URL to any web page.

Tammo


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The following user(s) said Thank You: labean0103

Please Log in to join the conversation.

More
2 months 3 days ago #236300 by labean0103
Okay, thank you! Yeah, I've been reading that manual about RemoteControl API and I just started learning about APIs and how to use them so I guess I will have to research that first and then try using that API.

About that first option

The "Yes" setting will allow a visitor to register his name and email address.

By "visitor" they mean just a person visiting the survey's page? Meaning that there will be created some input fields for a visitor's name/email etc. before the actual survey? It sounds interesting, but it doesn't quite fit my idea:( In the sense that I would like a user to first go to a page, fill in user's info and then choose a survey that they want to do and then they get redirected right to that exact survey already having an assigned token. But for now I was just thinking about how to transfer user input into participant list of the survey that the user has chosen. It's quite complicated, but thank you for the answer anyway!

Please Log in to join the conversation.

More
2 months 3 days ago #236301 by labean0103
Hey, thank you for the answer! Well, the thing is that I want a user to choose what survey they want to do and then get redirected to that survey while those user input information gets also redirected into that chosen survey's participant list! I wish it was that simple:)

Please Log in to join the conversation.

More
2 months 3 days ago - 2 months 3 days ago #236302 by Joffm
Hi,
I do not quite understand why you want to add the respondent data to a participant list.
If you do only this you have no link between this list and the data of the survey.

What you have to do:
  1. In survey 1 capture some data
  2. Do an ajax call to call a script (in any programming language that suits you, php python, java,...) that uses the API to enter this respondent to the participant table of the selected survey 2 and generate a token
  3. Return this token to survey 1
  4. In the end-url of survey 1 redirect to the selected survey 2 with the token of this participant.
    A simple nested IF, but better to generate the end-url in a question of type equation before.
Now you have a connection between the participant table and the responses tabel

But all this is not necessary with @tammo's solution.
You have the participant's data in survey 1, and you can merge them with the selected survey 2 by the "magic number" or you transfer them to survey 2 as parameter of the url.
The only difference is: in the first case you use a closed survey, otherwise an open survey.
I really do not understand, why you hesitate to try this.

Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 2 months 3 days ago by Joffm.

Please Log in to join the conversation.

More
2 months 2 days ago - 2 months 2 days ago #236312 by labean0103
Hey, I've been trying out the first solution with public registration, and the problem I have is that no email is sent when user submits info including the email address. Do I have to change smth in the settings for user to get the email invite link or what is the case?
Do I have to manually send the invitation links?
Last edit: 2 months 2 days ago by labean0103.

Please Log in to join the conversation.

More
2 months 2 days ago #236313 by labean0103
Hey, thank you for the answer. I was implying this kind of system: a user goes to an "application" site (LimeSurvey or not), there they enter their name info and email and choose what survey(s) they want to complete. Then, they get redirected to the chosen survey(s) where a token (for all the surveys the user has chosen) is generated in the background and is put into participants list of those surveys and user is automatically redirected and logged in into that chosen survey with already assigned token and it applies to all the surveys the user has chosen.
I wanted to explain the system a bit more to provide a clear understanding of what I mean by my question. I am a bit lost in all the options in LimeSurvey right now related to my idea and I am trying to work everything out, thank you for your solution.

Please Log in to join the conversation.

More
2 months 2 days ago #236314 by bismark
If you are good in programming php you can solve your problem with a LimeSurvey Plugin using the event system.
afterSurveyComplete is your starting point
manual.limesurvey.org/AfterSurveyComplete

In your event handler you can fetch the response by the given responseId. Then create a token based on response data.

Please Log in to join the conversation.

More
2 months 2 days ago #236317 by labean0103
Thank you! I'm okay with programming PHP but I'm having hard time using programming with LimeSurvey. This may be a stupid question, but where for example should I put all the code? In that link there is an example ShowResponse and I couldn't understand where they put this code :')

Please Log in to join the conversation.

More
2 months 2 days ago #236318 by bismark

Please Log in to join the conversation.

More
2 months 2 days ago #236319 by labean0103
Thank you lots! It's hard to find info about coding inside of LimeSurvey (for beginners) for some reason

Please Log in to join the conversation.

More
2 months 2 days ago #236321 by bismark
once you understood the plugin system of LimeSurvey, it is only the yii framework 1.1

Please Log in to join the conversation.

More
1 month 3 weeks ago #237790 by DenisChenu
there are a plugin create token and reponse in a related survey
gitlab.com/SondagesPro/SurveyAccess/surveyChaining
 

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.

Please Log in to join the conversation.

More
1 month 3 weeks ago - 1 month 3 weeks ago #239034 by labean0103
Hey! Thank you for the idea, but when I'm trying to use it I get this message:
500: Internal Server Errorcount():
Argument #1 ($value) must be of type Countable|array, null given
An internal error occurred while the Web server was processing your request.
Please contact Administrator to report this problem.
I'm wondering if I'm doing something wrong or there is some problem with the plugin
I'm going to look through the plugin code
Last edit: 1 month 3 weeks ago by labean0103.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now