DatStat: Illume Help Frames

1. 2. 12. 2. Ranking/Sum Check validation
1. 2. 12. 2. 1. Overview of Ranking/Sum Check validation << PreviousThe DatStat Object | NextSurvey requirements for using Ranking/SumCheck validation >>

Overview of Ranking and Sum Check validation

Ranking validation requires survey participants to enter sequential numeric responses for a minimum and/or maximum number of question items. Here is an example of a ranking question:

Sum check validation requires survey participants to enter numeric values for a group of questions whose sum equals some value or is between some specified minimum and maximum values. JavaScript code can also be supplied to update a running total that is displayed in the survey. Here is an example of a sum check question:

Ranking and sum check validation is normally performed using a group of questions which are normally part of a question table. Ranking and sum check validation requires that the data type of the questions be “Whole Numbers” or “Whole Numbers >= 0” and the display type of the questions be “Text Field”, “Select One – Poplist”, or “Select One – Radio Button”.

1. 2. 12. 2. 2. Survey requirements for using Ranking/SumCheck validation << PreviousOverview of Ranking/Sum Check validation | NextAdding Ranking validation >>

In order to use Ranking/Sum Check validation, Multi-Control component validation, or other custom client validation,
a survey must have originated from a version 4.7 survey template or the following conditions must be true:

1. 2. 12. 2. 3. Adding Ranking validation << PreviousSurvey requirements for using Ranking/SumCheck validation | NextAdding Sum Check validation >>

The following example demonstrates how to add ranking validation:

RankingValidation parameters

The RankingValidation parameters are separated by commas and must appear in the order as listed below.

Question list array

This value should be a comma-delimited list of single-quoted text values that are the form element names of the questions to be ranked all enclosed between beginning and end brackets ('[' and ']'). The {FormElement:} tag is normally used to specify the form element names for each of the questions.

Example: ['{FormElement:Q1}', '{FormElement:Q2}', '{FormElement:Q3}' ]

Error message

This is a text message enclosed in single-quotes. It is displayed if the user fails to uniquely rank the minimum and maximum number of items.

Required minimum rank items

This is the minimum number of items that are required to be ranked. This number is adjusted to the number of question items displayed on the page if that number is less than the minimum. An error message will be displayed it the survey participant fails to uniquely rank this minimum number of items.

Maximum rank items

This is the maximum number of items that can be ranked. An error message will be displayed if the survey participant ranks more than this specified maximum.

Sequential ranking

This is a true/false option. Set this option to true if you require ranking values to be sequential numbers starting with 1. This option is especially important if the ranking questions are of display type text field.

1. 2. 12. 2. 4. Adding Sum Check validation << PreviousAdding Ranking validation | NextMultiControl Overview >>

The following example demonstrates how to add sum check validation.  In this example, let's assume we want the sum of these questions to add up to 100.

SumCheckValidation parameters

The SumCheckValidation parameters are separated by commas and must appear in the order as listed below.

Question list array

This value should be a comma-delimited list of single-quoted text values that are the form element names of the questions to be ranked all enclosed between beginning and end brackets ('[' and ']'). The {FormElement:} tag is normally used to specify the form element names for each of the questions.

Example: ['{FormElement:Q1}', '{FormElement:Q2}', '{FormElement:Q3}' ]

Minimum allowed sum

This is a numeric value that is the minimum allowed by the sum check validation code.  This value should be less than or equal to the maximum allowed sum (i.e. the next parameter).

Maximum allowed sum

This is a numeric value that is the maximum allowed by the sum check validation code.  This value should be greater than or equal to the minimum allowed sum (i.e. the previous parameter).

Callback function

This is an optional argument. If not set to null, this argument should be a JavaScript function object that accepts 2 arguments:  1) the current running ‘total’; and 2) whether or not this value is ‘ok’ and fulfills the sum check minimum/maximum requirements.  This function is called whenever the sum of the questions changes.

Error message

This is a text message enclosed in single-quotes.  It is displayed if the sum of the responses isn’t between the required minimum/maximum values.  This error message can contain the following tag: {0} which will be replaced with the current total.