Section functions

February 6, 2019

Section functions (introduced in v19.02) are functions that may be used in Survey Solutions’ syntax to get some useful indicators about the completeness of the sections, such as to establish whether a certain section has been fully answered.

The following functions are defined for sections:

IsSectionAnswered()returns a boolean true if all the [enabled] questions in the section have been answered, and false otherwise.
EnabledQuestionsCount()returns the total number of questions currently enabled in the section.
NumberUnansweredQuestions()returns the total number of questions that have not been answered in the section.
EnabledAnsweredQuestionsCount()returns the total number of questions that have been answered in the section.

All of these functions must receive a certain section identifier as an argument, for example: IsSectionAnswered(DemogSect)

For example, if we want to enable section s2 only if at least half of the questions are answered in section s1, we can write the following expression for section s2:

EnabledAnsweredQuestionsCount(s1)>=NumberUnansweredQuestions(s1)