Welcome to the LimeSurvey Community Forum

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

Jumping back and forward between surveys

  • surveyman
  • surveyman's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 1 month ago #116591 by surveyman
Jumping back and forward between surveys was created by surveyman
I made a continuous survey with questions that only change once or twice a year. But sometimes (once or twice a month) I add questions that are shown temporarily. The problem is that each time I add these questions, I have to take the survey offline and the data structure changes. This changed data structure makes the process complicated, because I have to change my data analysis file each time the survey changes.

So I thought about a solution for this. Is it somehow possible to make two surveys (1. continous questions, 2. ad-hoc questions) and jump between them (with sending parameters to prefill information from one survey into another)? I looked a bit around in Limesurvey and found the "end survey link". I think it should be possible with this, but only at the end of the questionnaire. This would be a bit strange out of a users perspective. It would be great if it would be possible to start with survey 1 (the first few questions), then go to survey 2 and after completing the survey go back to survey 1 (and fill out the last few questions). Does anybody knows a work-around for this?
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 1 month ago #116593 by holch
Replied by holch on topic Jumping back and forward between surveys
I don't think this is possible to leave the survey, answer the second survey and go back to the first survey.

You could think of doing 3 surveys or maybe you could include survey 2 via an iframe into survey 1.

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.
  • surveyman
  • surveyman's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 1 month ago #116748 by surveyman
Replied by surveyman on topic Jumping back and forward between surveys
Ok, I'll have to find another solution than. Thank you. :)
The topic has been locked.
More
9 years 1 month ago #116773 by Bigred01
Replied by Bigred01 on topic Jumping back and forward between surveys
I'm typing this in my phone so hopefully it makes sense and isn't full of spelling/grammar issues.

This idea is a little hacky but I think it could work.

1. have token based response persistence on.
2. Have a hidden field on the same page as the last question before the forward happens. This will be to store a value when they return to the survey.
3. When they land on the page that has the forward, check the value of the hidden field on the previous page. If it's empty, forward them to the second survey.
4. At the end of the second survey, send them back to the original survey also passing some variable in the URL. With token based response persistence on they should land on the last question they answered. This will also be the page with the hidden field.
5. Read the URL, and if your variable is in it, store some value in the field so you can tell on the next page that they have answered the second survey. Once you store it you can auto next or just let them press next again since they would have already answered the question on this page.
6. They will now be landing on the page that originally forwarded them but since there is data in that hidden field, don't forward them this time.

Probably should use the same tokens across both surveys to keep the sample the same.
The following user(s) said Thank You: surveyman
The topic has been locked.
  • surveyman
  • surveyman's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 1 month ago #116831 by surveyman
Replied by surveyman on topic Jumping back and forward between surveys
That's an interesting idea. But how can I forward to the second survey without using the "end survey link"? Should I insert a javascript with the forward link into a further empty question group?
The topic has been locked.
More
9 years 1 month ago #116833 by Bigred01
Replied by Bigred01 on topic Jumping back and forward between surveys
Let say your survey has 10 questions and you want to forward the person after they answer the 5th question.

In the group that has the 5th question you will want to put a hidden question that will be answered when they re enter from the second survey. With response persistence, this should be the first group they land on when they re-enter the first survey.

In the group that has the 6th question you will have some javascript that checks to see if the hidden question in the previous group has been answered. If it hasn't you will then forward them to the second survey in the same script you used to check. You can do all of this checking before the page is even fully loaded so it should be pretty smooth.

After they have finished the second survey, you can set the end url to their original survey link. This is why it would be good to use the same tokens for both surveys then all you have to do is enter the link like survey.com/blahblahblah/token/{token}/la...econdsurvey=answered . At the end of the link is the variable you will be passing back to the original survey so you know they came from the second survey and not from the 4th question in the first.

When they re-enter the first survey, they should now be on the 5th question they previously answered. You will have to check the URL for the variable you passed through and if its there, answer the hidden question.

Now when they press next or if you auto next them they will land on the 6th question and your script will now see that the hidden question has been answered and will not forward them so they can continue on with the original survey.

The 5th question script will check for the url variable every time someone lands on that group but unless they are entering from the second survey, it wont be there and the hidden question wont be answered.
The topic has been locked.
  • surveyman
  • surveyman's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 1 month ago #116885 by surveyman
Replied by surveyman on topic Jumping back and forward between surveys
Interesting, thanks.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose