Actions

Expression Manager sample surveys

From LimeSurvey Manual

Revision as of 06:04, 30 March 2012 by TMSWhite (talk | contribs)

Introduction

The Limesurvey distribution includes sample surveys in the /docs/demosurveys folder that demonstrate all of the main Expression Manager-related functionality.  This page provides an overview of the functionality they provide, plus a convenient means of downloading them.

Sample Census

Overview

This is a pretend census that asks how many people are in your household, asks tailored follow-up for each person (up to 5), and generates a simple report.

It demonstrates how group-level relevance can make it easier to implement a "loop" of questions. After creating the group for Person 1, I exported the group. Since I used qcode variable names like p1_name instead of the SGQA code, I could use a text editor to quickly edit and re-import the group several times (e.g. it took about 10 seconds to edit and re-import each repeating group, ensuring that all variables had unique variables names and that the group-level logic was correct).

This also shows how you can prevent the Finished message from appearing until the survey is truly finished (e.g. all needed groups are completed).

EM Features Demonstrated

  1. Group-level relevance - The follow-up groups (Person 1-5) only show for up to the number of co-habitants specified.
  2. Tailoring - The final report summarizes the demographic data for each co-habitant
  3. Progressive question display - Whether in group or all-in-one mode, subsequent questions only show as soon as the preceding ones are answered.

Screen Shots

Download

ls2_group_relevance.lss

Cascading Array Filters

Overview

This survey is based off the design of a survey courtesy of Joy Lane Research, LLC. They identified a bug in 1.91+ which prevented proper use of cascading array filters.  In 1.91+, say you first pick several options from Q01 and Q02, then pick a favorite from Q04.  If you uncheck the favorite option in Q01, that option does not disappear from Q04.   We also discovered the 'other' option were not being handled correctly. This survey shows that LimeSurvey 1.92 with Expression Manager makes the cascading work correctly.   It also lets us pick an 'other' option and have its label carry through to subsequent questions.  This survey also shows that you can simultaneously use array_filter and array_filter_exclude (see question Q05).

Screen Shots

Download

ls2_cascading_array_filter.lss

All Question Types and Attributes

Overview

This survey shows how you can access question attributes and responses using Expression Manager. It provides:

  • Samples of every question type
  • Default values for any question type that accepts defaults
  • On and Off-Page Reports showing all 16 available EM dot notation suffixes
  • Proper Qcode and SGQA naming of all variables

Download

ls2_EM_question_attributes.lss

Validation Samples

Overview

This demonstrates all of the types of validation that can use expressions, and how they affect each of the question types that support validation.  In many cases, the validation tips start hidden and only appear if a question fails validation criteria  (thus also disappearing once the question passes validation criteria again).

Validation Types Demonstrated

  1. min_num_value_n - minimum value for an answer
  2. max_num_value_n - max value for an answer
  3. min_answers - minimum number of answers required
  4. max_answers maximum number of answers allowed
  5. multiflexible_min - minimum value allowed for an answer (for multiflexi numbers question type)
  6. multiflexible_max - maximum value allowed for an answer (for multiflexi numbers question type)
  7. min_num_value - minimum allowed sum across all answers for the question
  8. max_num_value - maximum allowed sum across all answers for the question
  9. equals_num_value - the sum across all answers for the question must equal this value