Welcome to the LimeSurvey Community Forum

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

Treatment groups based on SAVEDID

More
7 years 4 months ago - 7 years 4 months ago #146751 by ahog
Treatment groups based on SAVEDID was created by ahog
Hello everyone,

I'm conducting an experiment with 6 treatment groups. At the end of the pre-survey (using Limesurvey), the participant gets forwarded to a different site. The treatment group ID needs to be forwarded to this site.

I see two ways to to this:
1.) create a random ID (tgroup=rand(1,6)) in a hidden question i use to filter the shown questions - then I append this tgroup to the endURL. Is this possible? According to the manual only (?) {SAVEDID}, {TOKEN}, {SID} and {LANG} can be appended to the endURL.
2.) use the SAVEDID to assign the group (SAVEDID%6), as the SAVEDID is included in the endURL already. How do I then best refer to the SAVEDID to filter the the questions? JS feels a bit "dirty", perhaps there is an easier way.

The question to be filtered according to the treatment group is already on the first page after the welcome page. The pre-survey has only one question page with one text display question that exists in two versions, depending on the treatment group. I understood from a different board post, that the SAVEDID is not available before any questions are submitted. So I am not entirely sure, how to best solve this.

Thanks you :)
Andreas
Last edit: 7 years 4 months ago by ahog. Reason: typo
The topic has been locked.
More
7 years 4 months ago - 7 years 4 months ago #146755 by ahog
Replied by ahog on topic Treatment groups based on SAVEDID
partially solved:
SAVEDID is already available on the first page after the "welcome" page. So I can use it for the treatment group assignment.
The rest of the code (hiding groups via relevance) isn't quite working yet, although I copied an example from the forum. I'll probably will fix it soon, otherwise I'll post the code here.

Edit: The problem was, that I had the modulo-calculation in the question-text AND the "equation" field. Deleting the latter resolved the problem.

Now I have a (hopefully) final issue: when I hide the question(group) that determines the treatment-ID (1-6), it doesn't work anymore, but always shows the sametreatment-group. - example attached.
Last edit: 7 years 4 months ago by ahog.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose