Welcome to the LimeSurvey Community Forum

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

User Role based show/hide questions in a survey?

More
11 years 2 months ago #91020 by AriM
User taking the survey is authenticated, each user is assigned a GroupRole attribute in setup. In a survey questions are shown/hidden based on this attribute. Is this possible?
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
11 years 2 months ago #91022 by holch
This should be possible if you use tokens. You can include the GroupRole attribute as a custom attribute in the token table and then refer to it from within the survey logic and show or hide a question, depending on the GroupRole from the token table.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: AriM
The topic has been locked.
More
11 years 1 month ago #92315 by pedrorobalo
Replied by pedrorobalo on topic User Role based show/hide questions in a survey?
Hi holch,

Did you manage to implement it using tokens? I am trying to do something similar. I want the survey to be anonymous and I only want a limited number of subjects to participate, let's say 100. For 50 of them I want the variable (let's call it GroupRole) to take one value, say 1, and for the other 50 I want GroupRole to take value 2. Since I want the survey to be anonymous this means that any new user generates a new token (by introducing an e-mail account in the initial page), but for which the value of GroupRole is not defined... Did you run into a similar problem? Thanks for any feedback.
The topic has been locked.
More
11 years 1 month ago #92316 by AriM
Pedrorobalo,

Holch answered my question.
I did not go further than that using tokens.
We are using Version 1.92+ Build 120517.
In DEV environment using token attributes works
but in TST environment I get undefined variable error for token
(which was fixed in Build 120418). I am working on that!

In any case, you can try the following not sure if it will work though:
create an equation question that uses random function (generate 1 or 2)
use quotas for this question(equation) response: 1 ---> 50responses
and similarly for response 2. No need for tokens unless you need it for another reason.

Holch might have a better answer for you.

Good Luck,

AriM
The following user(s) said Thank You: pedrorobalo
The topic has been locked.
More
11 years 1 month ago #92318 by pedrorobalo
Replied by pedrorobalo on topic User Role based show/hide questions in a survey?
AriM,

Thank you very much, that might solve my problems.

Best
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose