Methods (also called functions) are pieces of code that are used for writing conditions or other logical expressions. A method takes one or more input values, performs an operation with those values, then returns an output value. Some methods are Boolean, meaning the value they return is "true" or "false". Other methods return different values such as numbers text.
IntelliSurvey's survey programming language (SPL) has a large set of built-in functions to support a wide variety of survey logic needs. Please see the links below for more details.
Example
The following example uses the anyChecked
method at the showif tag. There are two input values: $Q1 and 1. The output value will be true if the respondent selected option 1 at Q1; otherwise, it will return false. Thus, the question will be skipped if option 1 is not selected at Q1.
1. Do you own or lease a vehicle?
type: radio
1. Yes
2. No
2. What is the make and model of your vehicle?
type: text
showif: anyChecked($Q1,1)
Checked functions
Checked functions evaluate the answers the respondent selected (i.e., "checked") for a closed-end question. Checked functions are Boolean, with the exception of countChecked
, which returns the number of options selected.
List functions
List functions iterate over a list, check a condition, and return a value. There are seven list functions, and each returns a different type of value.
Other functions
This page has a list of miscellaneous functions with various uses such as controlling input, conditioning content dynamically, altering an input element's enabled and disabled states, and more.
Custom scripts and require.js
This article provides information on using how to access JavaScript libraries such as jQuery for use in surveys.
Comments
0 comments
Please sign in to leave a comment.