Skip to content
Matt Andreotta edited this page Mar 30, 2017 · 3 revisions

Wiki Conents

This wiki will detail some strategies to implementing JavaScript code in a Qualtrics environment. This wiki contains information on:

  1. General advice for running experiments and advanced survey methodologies in Qualtrics
  2. Advice for adding custom JavaScript and HTML code
  3. The Implicit Association Test, an example of an advanced methodology being implemented in Qualtrics
  4. Miscellaneous resources for implementing JavaScript code in Qualtrics
  5. Miscellaneous resources for implementing the Q methodology in Qualtrics, using JavaScript

Running JavaScript in Qualtrics

How does it work?

JavaScript code may be implemented through the text editor on Qualtrics. The Qualtrics text editor provides the option of coding text in HTML. By doing so, it is possible to create a JavaScript environment. However, this is complicated by the fact Qualtrics will consider the JavaScript code as a single question. Thus, in order to function correctly, the code requires particular variables to be defined (e.g. the QID, an internal index which Qualtrics uses to identify questions).

Options

Open-source, JavaScript platforms (OBSELETE)

Previously, it was possible to embed open-source JavaScript platforms, such as QRTEngine and jsPsych, into the Qualtrics environment. However, these platforms are not compatible with Qualtrics' newest survey engine (Jiffy). Although it is possible to use an older Qualtrics survey engine, it is likely such survey engines will be retired at some point. As such, using these platforms is not advised.

Coding from scratch

Although open-source, JavaScript platforms are no longer compatible with the latest Qualtrics survey engine, it is still possible to code a survey question from scratch. Useful JavaScript code is available in the repository.

References

Barnhoorn, J., Haasnoot, E., Bocanegra, B.R., & van Steenbergen, H. (2015). QRTEngine: An easy solution for running online reaction time experiments using Qualtrics. Behavior Research Methods, 47(4), 918-929.

de Leeuw, J. R. (2015). jsPsych: A JavaScript library for creating behavioral experiments in a web browser. Behavior Research Methods, 47(1), 1-12.

Clone this wiki locally