Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: User Role based show/hide questions in a survey?

User Role based show/hide questions in a survey? 1 Jahr 8 Monate her #91020

  • AriM
  • AriMs Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 5
  • Dank erhalten: 1
  • Karma: 0
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?
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: User Role based show/hide questions in a survey? 1 Jahr 8 Monate her #91022

  • holch
  • holchs Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 2670
  • Dank erhalten: 320
  • Karma: 120
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.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Folgende Benutzer bedankten sich: AriM

Re: User Role based show/hide questions in a survey? 1 Jahr 7 Monate her #92315

  • pedrorobalo
  • pedrorobalos Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 4
  • Karma: 0
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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: User Role based show/hide questions in a survey? 1 Jahr 7 Monate her #92316

  • AriM
  • AriMs Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 5
  • Dank erhalten: 1
  • Karma: 0
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
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Folgende Benutzer bedankten sich: pedrorobalo

Re: User Role based show/hide questions in a survey? 1 Jahr 7 Monate her #92318

  • pedrorobalo
  • pedrorobalos Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 4
  • Karma: 0
AriM,

Thank you very much, that might solve my problems.

Best
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Moderatoren: ITEd
Ladezeit der Seite: 0.125 Sekunden
Donation Image