- Posts: 11655
- Thank you received: 2740
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Can I set which questions a participant sees based on pre-defined attributes?
- holch
- Offline
- LimeSurvey Community Team
Less
More
5 years 10 months ago #170332
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Can I set which questions a participant sees based on pre-defined attributes?
That is not really true. You can have questions on the same page, that are hidden, until you click a certain response for a question. This question can be on the same page. But of course you can't hide a group based on a answer within that same group.but only if those previous answers were on a preceding page (ie, in a different group!).
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
- drcraig
- Topic Author
- Offline
- New Member
Less
More
- Posts: 10
- Thank you received: 0
5 years 10 months ago - 5 years 10 months ago #170333
by drcraig
Replied by drcraig on topic Can I set which questions a participant sees based on pre-defined attributes?
I figured there was probably a way to do that, just more complicated than my understanding.
I posted on another issue, but I think I figured it out. I was having an issue with this statement: r01 == "A1" AND r02 == "A3" OR "A4". It wasn't giving an error, but it also wasn't hiding the desired group.
I discovered I need brackets around the AND statement to make the OR portion work independently of the part prior to the AND.
Example: r01 == "A1" AND (r02 == "A3" OR "A4")
I posted on another issue, but I think I figured it out. I was having an issue with this statement: r01 == "A1" AND r02 == "A3" OR "A4". It wasn't giving an error, but it also wasn't hiding the desired group.
I discovered I need brackets around the AND statement to make the OR portion work independently of the part prior to the AND.
Example: r01 == "A1" AND (r02 == "A3" OR "A4")
Last edit: 5 years 10 months ago by drcraig.
The topic has been locked.
- drcraig
- Topic Author
- Offline
- New Member
Less
More
- Posts: 10
- Thank you received: 0
5 years 10 months ago - 5 years 10 months ago #170334
by drcraig
Replied by drcraig on topic Can I set which questions a participant sees based on pre-defined attributes?
Nope, that didn't work. I'm having all kinds of problems with this syntax.
Here is an example:
Group relevance expression: r01 == "A1" AND (r02 == "A3" OR "A5")
If I select r01 = A1, and r02 = A2, this group still shows.
If I place the brackets like this:
r01 == "A1" AND r02 == ("A3" OR "A5")
LS returns an empty page (no questions, but with a "next" box), but since the fields are mandatory, it says you must still complete them. Weird.
If I eliminate the "OR" statement all together, it works. So that seems to be where the problem is.
UPDATE... trial and error seems to have worked.
r01 == "A1" AND r02 == "A3 OR A5"
Putting the quotes around the grouped answers did the trick. For now!
UPDATE... not so fast. That didn't work. But this did:
r01 == "A1" AND (r02 == "A3" OR r02 == "A5")
I'm including all these updates to make my process explicit for anyone else who might be going through the same educational process I am. Would be nice if the manual were helpful here! I've learned a little bit by reading up on Boolean expressions.
Here is an example:
Group relevance expression: r01 == "A1" AND (r02 == "A3" OR "A5")
If I select r01 = A1, and r02 = A2, this group still shows.
If I place the brackets like this:
r01 == "A1" AND r02 == ("A3" OR "A5")
LS returns an empty page (no questions, but with a "next" box), but since the fields are mandatory, it says you must still complete them. Weird.
If I eliminate the "OR" statement all together, it works. So that seems to be where the problem is.
UPDATE... trial and error seems to have worked.
r01 == "A1" AND r02 == "A3 OR A5"
Putting the quotes around the grouped answers did the trick. For now!
UPDATE... not so fast. That didn't work. But this did:
r01 == "A1" AND (r02 == "A3" OR r02 == "A5")
I'm including all these updates to make my process explicit for anyone else who might be going through the same educational process I am. Would be nice if the manual were helpful here! I've learned a little bit by reading up on Boolean expressions.
Last edit: 5 years 10 months ago by drcraig.
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11655
- Thank you received: 2740
5 years 10 months ago #170336
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Can I set which questions a participant sees based on pre-defined attributes?
can you provide .lss survey file for us to have a look at it?
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
- drcraig
- Topic Author
- Offline
- New Member
Less
More
- Posts: 10
- Thank you received: 0
5 years 10 months ago #170339
by drcraig
Replied by drcraig on topic Can I set which questions a participant sees based on pre-defined attributes?
Here it is!
Attachments:
The topic has been locked.