Welcome to the LimeSurvey Community Forum

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

Integration of / link to external experiment in middle of survey

More
7 years 4 months ago #145228 by ahog
Hello everyone,

I want to conduct an online experiment with a pre- and post-survey. For the surveys I'd like to use LimeSurvey. The experiment itself runs on the same websever as LimeSurvey. The whole process of the two surveys and the experiment should be one workflow without interruption for the user. The results of all three parts have to be matched via an unique ID.

Is it possible to either:
  • link to the experiment in the middle of the survey and come back to the survey after the experiment (e.g. two pages of survey -> experiment -> two further pages of survey - preferred soluton), or
  • link from the first survey (pre-survey) to the experiment and from the experiment to the second survey (post-survey)?
If it is possible: how would I best go about implementing this solution? If not: do you have any other ideas or recommendations?

Thank you a lot!

Best regards
ahog
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 4 months ago #145232 by Joffm
Hi, ahog,

the easiest solution is: Use two survey and link everything by endurl
1. First Survey -> endurl leads to experiment and passes the ID
2. experiment -> click on "Finish" or whatever calls the second survey and passes the ID
3. Second survey.

Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: ahog
The topic has been locked.
More
7 years 4 months ago #145269 by ahog
Thanks for the quick and helpful reply, Joffm!

Seems to be fairly easy and I at least get the first half to work.
Unfortunately I haven't managed to get the UserID back to the second survey. I followed the manual and tried to feed the UserID into a short text question as GET Parameter through Panel Integration. I also tried prefilling the survey directly through the get parameter. Neither does anything to fill the designated short text question. Is there something special to consider or is there another way to pass the UserID to the second survey?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 4 months ago #145271 by tpartner
What LimeSurvey version are you using?

Can you give examples of the survey URLs you are using for panel integration and prefilling?

Have a look at this (extended) discussion about panel integration with a sample survey - www.limesurvey.org/forum/can-i-do-this-w...?limitstart=0#145050

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: ahog
The topic has been locked.
More
7 years 4 months ago #145272 by ahog
I'm using Version 2.56.1+161118.

Panel Integration: The survey URL ist http://[URL]/limesurvey/index.php/741335?UID=1234 for the panel integration.

Prefilling: My prefilling string was probably wrong. I have to understand EM and qcode better first. I wanted to fill the UID into a textfield with Code "UIDQuestion" (Question Group 1, Question 2) mySQL column name is "741335X3X8" .

I'll check out your sample and go from there - thank you :)[/url]
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 4 months ago #145275 by Joffm
Hi, ahog.

in my opinion you just add the userID to the endurl which leads to the experiment, like:
http:///www.myExServer.com/myExperiment.php?id={userID}
{userID} you grabbed by an equation.

I assume that the experiment is programed by yourself. So you receive the userID there in the GET-Parameter:
$userID=$_GET;

and at the end of the experiment you add this userid to the url which calls the second LS survey
<a href=" www.myServer.com/limesurvey/index.php/ [SurveyID]?lang=en&userid={$userid}">Next</a>

Unfortunately I deleted the similar example a few days ago.
But I will create a new one later.

Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 4 months ago - 7 years 4 months ago #145287 by Joffm
Hi, ahog,
as promised here an example:
616548 is the first part: the endurl is:
www.expServer.com/exp/exp1.php ?id={TOKEN:TID}

In the experiment I grab the ID by the GET-Parameter. See the very simple php-file (extension changed to "txt" because of forum limitation)
Finishing the experiment calls the link
<a href=" www.Limesurvey.com/survey/index.php/987634?&newtest=Y&userID= [$userid]">To Survey</a>
This userID is grabbed in the first - hidden - question of type "short text" of the second survey (987634)
In the next question - the first of the respondent I show it, just to proove.

Well, this is just a small example.

And now something I saw right now. You have to save the UserID of the first survey somewhere - e.g. by an equation.
It is not included in the export.

Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 7 years 4 months ago by Joffm. Reason: Typo
The following user(s) said Thank You: ahog
The topic has been locked.
More
7 years 4 months ago #145291 by ahog
Great, that helps. I will check out your example as soon as I have access to my server.

The problem might be simple: I didn't include "newtest=Y" in my URL. When I append it, it works ... :blush: :pinch:

I use {SAVEDID} in my End URL as userid. So I it should be available in the DB. For the second survey, I will save it to a hidden question.

Now I only have to figure out, how I can stretch /manually modify the progress bar over two suveys and adapt the layout to make everything look like one large survey/experiment. Then I should be fine.

Thanks again a lot for your effort and help :)
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 4 months ago #145295 by tpartner
Here's a tip on how to override the progress bar - www.limesurvey.org/forum/design-issues/1...den-questions#139914

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose