Inhaltsverzeichnis

JavaScript Library SoSciTools

SoSci Survey automatically includes a JavaScript library SoSciTools in the questionnaire. It can be used in JavaScripts within the questionnaire.

SoSciTools

The following static methods are available through SoSciTools:

Questionnaire Elements

Questionnaire Control

Buttons in the Questionnaire

General Helper Functions

Dynamic Filters

SoSciTools.Questionnaire

The variable SoSciTools.questionnaire contains an object of the class SoSciTools.Questionnaire. The object SoSciTools.questionnaire is also available under the alias s2 (window.s2).

The object supports the following methods:

In addition, (most) questions on the questionnaire page are represented by a JavaScript object within s2. It is available under the ID of the question. A selection question with the ID SE01, for example, is available as s2.SE01. This is an object of the class SoSciTools.Question.

SoSciTools.Question

(Most) questions are represented by an object of the class SoSciTools.Question. This object has the following properties:

In addition, the following method is available:

Some question types (e.g. the selection) trigger an event 'response' when respondents interact with the question. The event (CustomEvent) has the following properties:

SoSciTools.Progress

The variable SoSciTools.progress contains an object of the class SoSciTools.Progress and supports the following methods: