how may I present one out of two different question texts asking for the same numerical input - depending on tokens and/or answers to prior questions?
What I've been trying (and struggling with - don't mind the fictitious text examples but the syntax):
{If(q01 != 01) OR If(q02 == 01) "How many parents do you know?"}
{If(q01 == 01) "How many people do you know?"}
If(q01 != 01 or q02 == 01, "How many parents do you know?",
If(q01 == 01, "How many people do you know?",""),"")
The syntax if(test,result_if_true,result_if_false) applied to my case:
test (based on different questions each):
q01 != 01 or q02 == 01
result_if_true:
"How many parents do you know?"
result_if_false:
"How many people do you know?" - but only If(q01 == 01)
result_if_false (that is: none of above mentioned tests true):
Hide question!
As you see, I need to kind of combine relevance (works) and tailoring (doesn't work) - Can I do this with LimeSurvey?
Which error are you getting?
As per " I need to kind of combine relevance (works) and tailoring", you would need to use 2 expressions at relevance equation and also for tailoring.
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
you mean, how the question appears on the survey page?
Well, the If(...) syntax appears as plain text in the question field (see attached jpg). Is this what you were asking for?
(However, the relevance equation works.)
sorry - the very first time I entered the syntax with curly braces, LimeSurvey responded no valid syntax, so I took them out :whistle: :blush: .
Now, I noticed that the error was I had put "If" instead of "if". So now syntax with curly braces is OK, but doesn't work effectively.
... And after noticing that (using the default Yes/No-question type) "Yes" is the 'Y' and "No" is saved as 'N' (instead of 1 and 2) in the response data, the correct wording is presented for the correct condition.
Now it works perfectly - even with two "if"
{if(q01 == 'Y' or q02 == 'A1', "How many parents do you know?", "How many people do you know?")}