The series
tag automatically generates sequential list options within a specified range. It is valid on any widget where regular options can be directly placed.
1. How would you rate your experience with Brand X?
type: radio
series: 1..5
headings: Terrible, Excellent
Tip! The series
tag can only be used in place of the optsfrom
listcall tag and does not support text
decorators. For most use cases, use the series
function, e.g., rowsfrom: series[1..5]
instead.
Details
-
The
series
tag is designed to replace theoptsfrom
tag and can only be used for generating answer options. -
The
series
tag can define either numeric or alphabetic sequences, e.g.,series: A..E
. When defining alphabetic series, consistent capitalization should be used. -
To display a list from highest to lowest value (or letter), you can reverse the upper and lower bounds, e.g.,
series: 5..1
orseries: Z..A
.
Additional examples
Creating a standalone list
If a list using the series
tag is used for multiple questions, a set list
can be defined with the tag instead of having to redefine the list on each question.
set list: YEARS
series: 2001..2025
2. In what year did you start working for IntelliSurvey?
type: pulldown
optsfrom: YEARS
Using non-continuous sets
The series
tag also accepts non-continuous sets. Simply use commas to separate any breaks in the sequence.
4. Which of the following jersey numbers would you prefer to wear?
type: pulldown
series: 0,7..9,11..15,20..24,30
Combining with a Perl expression
Complex Perl expressions can also be used to define the series
list of numbers. In the below example, the expression displays the even numbers '2', '4', '6', '8', and '10'.
set list: EVENNUMBERS series: map { $_ * 2 } 1..5
Comments
0 comments
Please sign in to leave a comment.