- Posts: 103
- Thank you received: 2
Ask the community, share ideas, and connect with other LimeSurvey users!
Hard to do …oleggorfinkel wrote: …
So, I am at the end of my rope here. Isn't there a way to either keep a relevance equation from breaking down completely when one variable is undefined, or else, to assign a value to a question, such that it would be immediately available for relevance testing on the same form?…
So, to fix the open mode processing, I took the token attribute test out of the Salary reference equation, leaving it at just (EmpStatus == "yes"), and then tried to make this work for closed mode by adding a hidden Equation-type question at the start of the form setting EmpStatus to the value of the attribute:
{EmpStatus = TOKEN:ATTRIBUTE_4.NAOK}
{TOKEN:ATTRIBUTE_4}
mpStatus == "yes" OR equation1 == "yes"
tpartner wrote:
So, to fix the open mode processing, I took the token attribute test out of the Salary reference equation, leaving it at just (EmpStatus == "yes"), and then tried to make this work for closed mode by adding a hidden Equation-type question at the start of the form setting EmpStatus to the value of the attribute:
{EmpStatus = TOKEN:ATTRIBUTE_4.NAOK}
Instead of that, try loading another equation question with the token value and reference that in the relevance equation for "Salary".
So, for example, an equation question with code equation1, with this as a value:Code:{TOKEN:ATTRIBUTE_4}
And, this for the relevance equation:Code:EmpStatus == "yes" OR equation1 == "yes"
You will still get an error in equation1 in the open survey but I don't think that will affect your relevance equation.
DenisChenu wrote:
Did you try without the .NAOK ?
davebostockgmail wrote: I would just add in a hidden single choice list question and then populate that with the punch you need via an equation question... something along the lines of this ...
RespType: Hidden Question with the responses 1) From Token 2) From Open
Equation question :
{RespType =(if TOKEN:ATTRIBUTE_4.NAOK=="Yes",1,2)}
and then use RespType as part of the filter in your question ....
I think it's an issue :oleggorfinkel wrote:
DenisChenu wrote:
Did you try without the .NAOK ?
Thanks for the suggestion, Denis. Yes, I did try that, but it didn't make a difference...
DenisChenu wrote:
I think it's an issue :
TOKEN:TOKEN.NAOK must send an error : allways
NAOK or shown are always for question, not fixed var : www.limesurvey.org/manual/Expression_Man...#Access_to_Variables
You can report issue BUT : we create false var for core token (TOKEN, FIRSTNAME etc …) but not for the 255 and more attribute …oleggorfinkel wrote: Another strange thing is that TOKEN:TOKEN CAN, in fact, be tested in relevance expression logic, and simply returns an empty string when undefined (i.e. when the participant table has not been initialized). TOKEN:ATTRIBUTE_X, however, fails and breaks the whole expression. To me, that doesn't make sense. …