Welcome to the LimeSurvey Community Forum

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

connecting surveys

More
10 years 3 weeks ago #105656 by uba
connecting surveys was created by uba
Hi,

I've set up a questionnaire, and after respondents complete the questionnaire, I will redirect them to a second questionnaire which is not a limesurvey questionnaire (it is javascript-based).

I'd like to pass respondents' token values from the limesurvey questionnaire to the second, non-limesurvey questionnaire, so that I can later merge the datasets. Anyone have any experience doing this?

Thanks.
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
10 years 3 weeks ago #105658 by Mazi
Replied by Mazi on topic connecting surveys
You can use the end URL feature to load the second survey. The token can be added to that URL using
"...&usertoken={TOKEN}..."

Limesurvey should automatically replace the placeholder with the current user's token so you can read that value from URL at the second survey.

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The following user(s) said Thank You: uba
The topic has been locked.
More
10 years 3 weeks ago #105664 by uba
Replied by uba on topic connecting surveys

Mazi wrote: You can use the end URL feature to load the second survey. The token can be added to that URL using
"...&usertoken={TOKEN}..."

Limesurvey should automatically replace the placeholder with the current user's token so you can read that value from URL at the second survey.


I did this (added "&usertoken={TOKEN}" to the end of the end url) and the token was added to the url of the second survey's entry page, as such "...index.php&usertoken=xiqv5et

However this resulted in a 404 "page not found" error rather than the index.php showing up. Did I do something wrong, or perhaps neglect to do something obvious?

Thanks.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 3 weeks ago #105665 by tpartner
Replied by tpartner on topic connecting surveys
If the "second questionnaire which is not a limesurvey questionnaire", we can't help you with accessing it.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
10 years 3 weeks ago #105666 by Mazi
Replied by Mazi on topic connecting surveys
Try replacing "...&usertoken..." with "...?usertoken..."

The first passed URL parameter always needs to use "?".

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The following user(s) said Thank You: uba
The topic has been locked.
More
10 years 3 weeks ago #105693 by uba
Replied by uba on topic connecting surveys

tpartner wrote: If the "second questionnaire which is not a limesurvey questionnaire", we can't help you with accessing it.


I understand. Actually it is not really a questionnaire, but a javascript-based Implicit Association Test. Originally I wanted to use the Limesurvey workaround to implement it, but apparently it isn't possible to use images in the Limesurvey version, so I had to find an alternative.
The topic has been locked.
More
10 years 3 weeks ago #105694 by uba
Replied by uba on topic connecting surveys

Mazi wrote: Try replacing "...&usertoken..." with "...?usertoken..."

The first passed URL parameter always needs to use "?".


This worked, thanks!! Now I just need to figure out how to pull the parameter from the URL to the second survey's dataset, which I realize isn't a Limesurvey issue.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 2 weeks ago - 10 years 2 weeks ago #105704 by tpartner
Replied by tpartner on topic connecting surveys

...apparently it isn't possible to use images in the Limesurvey version...

The IAT workaround will work with images if you make one small change.

Place images in your array sub-questions and then, in template.js, change both instances of this:
Code:
$('div.iatWord', thisQuestion).text($('.subquestion-list.unanswered:first .answertext', thisQuestion).text());

To this:
Code:
$('div.iatWord', thisQuestion).html($('.subquestion-list.unanswered:first .answertext', thisQuestion).html());

Here is a working template and survey.

File Attachment:

File Name: Demo_IAT_C...ages.zip
File Size:76 KB

File Attachment:

File Name: limesurvey...2945.lss
File Size:18 KB




.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 10 years 2 weeks ago by tpartner.
The topic has been locked.
More
10 years 2 weeks ago #105729 by uba
Replied by uba on topic connecting surveys
Thanks very much, I'll try it out!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose