Welcome, Guest
Username: Password: Remember me

TOPIC: Possible to go to different survey from question?

Possible to go to different survey from question? 3 years 1 month ago #67687

  • bwoo5
  • bwoo5's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 80
  • Thank you received: 4
  • Karma: 0
How would I go about having a question on a survey that has the user select their region and based on this selection it takes them to another survey? There is alot involved so can't use conditionals, actually need a separate survey for each region but would like to know the best way for them to answer one question, then be taken to that survey.

Thanks!
The administrator has disabled public write access.

Re: Possible to go to different survey from question? 3 years 1 month ago #67706

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4371
  • Thank you received: 829
  • Karma: 381
Can you do the redirect with a remote PHP script instead of using the first survey?

If no, do they need to complete survey 1 or just be redirected as soon as they answer the question?
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: Possible to go to different survey from question? 3 years 1 month ago #67707

  • bwoo5
  • bwoo5's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 80
  • Thank you received: 4
  • Karma: 0
Hey tpartner thanks for the reply. We would like to have them redirected as soon as they answer that first question. The use for the first question is so that we can track how many people answer the first question compared to how many complete the survey for their region.

Thanks.
The administrator has disabled public write access.

Re: Possible to go to different survey from question? 3 years 1 month ago #67708

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4371
  • Thank you received: 829
  • Karma: 381
Ah, I see.

So the "Region" question will need to be on the last (or only) page of survey 1 so the data will be stored in a "completed survey" record.

I assume you are not using tokens.

Can you attach an export of the "Region" question? I'll give you a sample redirect script.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: Possible to go to different survey from question? 3 years 1 month ago #67725

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6551
  • Thank you received: 869
  • Karma: 257
Hello,

Maybe you can use INSERTANS in end url link, and use some javascript.
  1. In the select answer, use the id of the survey for code of each region
  2. Add a text question to take the code
  3. Add some javascript to fill the text question with the code ( surveyid) of the selected option.
  4. Use the ansertans for end URL like this : yoursurveyurl/index.php?sid={INSERTANSsssXgggXqqq} where INSERTANSsssXgggXqqq is the one of the text question.


For the script : somethink like that:
<script type="text/javascript" charset="utf-8">
var qidselect = XXX
var qidtext = YYY
$(document).ready(function() {
$('#question'+qidtext).hide();
$('#question'+qidselect+' select').change(function() {
$('#question'+qidtext+' input.text').val($('#question'+qidselect+' select option:selected').val());
});
});
</script>

:)
Last Edit: 3 years 1 month ago by DenisChenu.
The administrator has disabled public write access.

Re: Possible to go to different survey from question? 3 years 1 month ago #67756

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5426
  • Thank you received: 307
  • Karma: 252
The simplest solution would be to let the user answer the first question and then use the auto load end URL feature to direct the user to a to be coded script. You can pass the answer data by URL and the script then does a simple mapping of:
passed region -> URL

Then this script can automatically redirect the user to the according survey.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.111 seconds
Donation Image