This translation is older than the original page and might be outdated. See what has changed.
Translations of this page:
 

JavaScript Library SoSciTools

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

SoSciTools

The following static methods are available through SoSciTools:

Questionnaire Elements

  • SoSciTools.getForm() – Returns the HTML form element <form> of the questionnaire.
  • SoSciTools.disableInputs() – Deactivates all input and selection fields on the current questionnaire page (e.g. to display questions again without the participant changing anything, see also answers())
  • SoSciTools.disableInputs2() – Replaces all input and selection fields with graphics or text elements.

Questionnaire Control

  • SoSciTools.submitPage() – Transmit the responses of the current page, as if the Next button was pressed.

Buttons in Questionnaires

  • SoSciTools.submitButtonsHide() – Hide next and back button
  • SoSciTools.submitButtonsDisplay() – Show next and back button
  • SoSciTools.showButtons() –Display of Next and Back button or other buttons (language switcher, cancel interview, interrupt interview) control
  • SoSciTools.submitButtonEnable() – Switch the Next button active or inactive (disabled)

General Help Functions

SoSciTools.Questionnaire

The variable SoSciTools.questionnaire hosts an object of the class SoSciTools.Questionnaire. The object supports the following methods:

The variable SoSciTools.questionnaire hosts an object of the class SoSciTools.Questionnaire

  • attachCheck() – Registers a function to check the input. The function is called when the participant uses the Next button.
  • submit() – Transmit the responses of the current page, as if the Next button was pressed.

SoSciTools.Progress

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

  • addEventListener() – Registers a function for the events 'present' or 'change'.
  • set() – Changes the displayed percentage value. Unlike the PHP function option('progress', ...), this does not affect the percentage value displayed on the following page.
en/create/soscitools.txt · Last modified: 27.05.2021 15:06 by sophia.schauer
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki