The key components of ExpressionManager are now completed for non-dynamic use (in the limesurvey_dev_tms branch). Complex equations can be used to specify whether questions should be shown as long as the values in that equation are not changed on the page. Work is starting on making Relevance as dynamic as Conditions (e.g. making the equations work in JavaScript).
Briefly, here's how it works:
(1) All questions now have a "Relevance" Question Attribute with a default value of 1. This should be an equation that evaluates to a Boolean result.
(2) For each question in a group, if the question is not Relevant, then:
(a) No part of the question will be written to the generated HTML file
(b) The value will not be changed (e.g. it will not be set to Not Applicable)
(3) If the question is Relevant (or there is no Relevance attribute set), the question will be displayed (unless Conditions make it invisible).
(4) If there are no relevant questions in a group, then the entire group will be skipped
(5) If there are no relevant questions in the last group, then the results will be automatically submitted and the respondent will advance to the End Message
(6) If the question is irrelevant, then the question is skipped even if it is Mandatory
More details can be found at these links:
ExpressionManager,
Relevance,
Equation Question Type
Key questions for the developer community now include:
(1) Should the responses to irrelevant questions NULLed out?
(a) Always, or only when $deletenonvalues==true?
(b) What is the preferred way to deleting the value from $_SESSION[SGQA]? unset($_SESSION[SGQA])? $_SESSION[SGQA]=''?
(2) Relevance could let a survey finish quickly - e.g. don't ask the last 10 groups of questions if the subject is a minor. However, in such cases, the subject will not see the Submit button since that is only present on the last Group.
(a) Is that behavior acceptable, or should the system try to detect that all future groups would be irrelevant and in such cases make the Submit Button visible?
(3) For questions that could never be visible on the page, should no part of that question be written to the HTML, or should some of the <hidden> fields be written?