Welcome, Guest
Username: Password: Remember me

TOPIC: Controlling question display with Relevance Attribute and ExpressionManager

Controlling question display with Relevance Attribute and ExpressionManager 2 years 9 months ago #63541

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 81
  • Karma: 36
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?
The administrator has disabled public write access.

Re: Controlling question display with Relevance Attribute and ExpressionManager 2 years 8 months ago #63886

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 81
  • Karma: 36
ExpressionManager is now operational in the limesurvey_dev_tms branch. This includes dynamic on-current-page Assessments, conditions, and tailoring (e.g. change the value of some questions or boilerplate text displays as you type responses to other questions)

More information can be found on the wiki page [url=http://http://docs.limesurvey.org/Expression+Manager]here[/url].
The administrator has disabled public write access.

Re: Controlling question display with Relevance Attribute and ExpressionManager 2 years 8 months ago #63938

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 81
  • Karma: 36
Attached is a 2 page demo of ExpressionManager that shows how it supports dynamic (e.g. on the current page):
  1. Calculations, Assessments & Reports - Page 1 shows many math facts for the numbers as you enter them
  2. Conditional Relevance (e.g. complex conditions) with cascading - Page 2 conditionally asks questions about your age, marital status, and number of children, but only showing potentially relevant questions based upon your age and prior responses
  3. Conditional Micro-Tailoring - Page 2 provides a running commentary about the information you entered at the bottom of the page
  4. Blanking out Non-Applicable (e.g. irrelevant) responses. Page 2 shows that if you first enter an adult age and information about children, then change the entered age to 4, all of the questions that depend upon age get blanked out. This feature is used to support cascading logic in the Relevance equations so that you don't have to attach all relevance criteria to each question.

File Attachment:

File Name: ExpressionManager-Demo.lss
File Size: 64 KB
The administrator has disabled public write access.

Re: Controlling question display with Relevance Attribute and ExpressionManager 2 years 8 months ago #63940

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2451
  • Thank you received: 256
  • Karma: 94
This will only work with the development branch, right?

By the way: From what I have seen, this ExpressionManager seems to be incredible. Can't wait for the first demo to play around with it.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Re: Controlling question display with Relevance Attribute and ExpressionManager 2 years 8 months ago #63941

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 81
  • Karma: 36
This only works in the limesurvey_dev_tms branch. Details for accessing it are on the wiki here

That branch is operational, so feel free to play with the demo and create others.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.112 seconds
Donation Image