Welcome, Guest
Username: Password: Remember me

TOPIC: Strange behavior of the expression manager with formula conditions

Strange behavior of the expression manager with formula conditions 2 years 3 months ago #77485

  • nkorf
  • nkorf's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 12
  • Thank you received: 1
  • Karma: 1
Dear all,

I am migrating a hard coded patient protocol to limesurvey using the newly developed
Expression Manager and i am stuck with a very strange problem.
I have two equation questions containing the same formula which calculates the answers of
questions entered previewsly by the user (age, number of falls and number of fractures).
Then i have 12 text display questions which are shown based on conditions imposed on the
formula result.
While works perfect on all the 11 questions, for a question (fifth in a row) that is
using the same conditioning variables as all the others it fails to show it. If my two
variables are between 96 and 103 the question is not showing while for all
the other variables it works very nice.
Another issue that i managed to resolve was the case of comparing with decimals
obtained from the equation questions where the result was a decimal number with (,)
and the relevance equation was treating it like a string. Doing a str_replace of the (,)
with the (.) solved it.

My condition logic is the following (obtained from the survey logic file)

((T_score.NAOK >= "-5") and (garvan_points.NAOK >= "0") and (garvan_points2.NAOK < "38.88889"))

((T_score.NAOK >= "-5") and (garvan_points.NAOK >= "38.88889") and (garvan_points2.NAOK < "56.66667"))

((T_score.NAOK >= "-5") and (garvan_points.NAOK >= "56.66667") and (garvan_points2.NAOK < "75.77778"))

((T_score.NAOK >= "-5") and (garvan_points.NAOK >= "75.77778") and (garvan_points2.NAOK < "87.11111"))

((T_score.NAOK >= "-5") and (garvan_points.NAOK >= "87.11111") and (garvan_points2.NAOK < "96"))

((T_score.NAOK >= "-5") and (garvan_points.NAOK >= "96") and (garvan_points2.NAOK < "103.77778"))

((T_score.NAOK >= "-5") and (garvan_points.NAOK >= "103.77778") and (garvan_points2.NAOK < "110.44444"))

((T_score.NAOK >= "-5") and (garvan_points.NAOK >= "110.44444") and (garvan_points2.NAOK < "117.11111"))

((T_score.NAOK >= "-5") and (garvan_points.NAOK >= "117.11111") and (garvan_points2.NAOK < "124.66667"))

((T_score.NAOK > "-5") and (garvan_points.NAOK >= "124.66667") and (garvan_points2.NAOK <= "134.22222"))

((T_score.NAOK >= "-5") and (garvan_points.NAOK > "134.22222") and (garvan_points2.NAOK < "150.44444"))
((garvan_points.NAOK >= "150.44444") and (garvan_points2.NAOK < "200.000001"))
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.103 seconds
Donation Image