![]() ![]() If you had any typos (such as misspelled or undefined variable names or functions), EM would show an error, such as this, showing that height_unit is an undefined variable name (it is actually height_units), and rnd() is an undefined function (the proper function name is round()). ![]() Here is the edit window for the same question.Īs you can see, anything in curly braces is treated as an expression, so is syntax-highlighted (color coded) in the prior image. This results from the fact that tailoring inserts a tag which is not valid inside select options. Note: Dynamic tailoring may not work if answer options are made available in select boxes on the same question page. Expressions can span multiple lines if, as in this case, you want to make it easier to read the nested conditional logic. ![]() Tailoring must surround expressions with Curly Braces.You can see its equation in the Show Logic Viewįrom the edit window for this question, you can see two things: ("You said you are 2 meters tall and weight 70 kg.")Īlthough not well shown in the above image, weight_status uses nested if() statements to categorize the person as underweight to severely obese. Lastly, the report conditionally tailors the message for the subject, telling him what he entered. So, the relevance of weight, weight_units, height and height_units are all 1, meaning that those questions are always asked. The relevance equation is shown in square bracket right after the variable name (which is in green). This image shows one way to review the relevance logic for a survey. This is similar to what can be done via the Conditions editor, but EM lets you easily specify much more complex and powerful criteria (and lets you use the variable name rather than SGQA naming). ![]() If the question is relevant, then the question is shown, otherwise it is Not Applicable, and the value NULL is stored in the database. EM uses a Boolean relevance equation to specify all of the conditions under which a question might be valid. This approach is very limiting, since is hard to validate, and easily breaks when you have to re-order questions. Some surveys use "Goto Logic", such that if you answer Question 1 with option C, then jump to Question 5. Relevance (Controlling Navigation/Branching) The following sections show the main places where Expression Manager is used It also lets you access your variables using human-readable variable names (rather than SGQA names). EM currently provides access to 80 functions, and can be easily extended to support more. Nearly anything that you can write as a standard mathematical equation is a valid expression, even if you are calling functions.
0 Comments
Leave a Reply. |