This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Set an embedded data element called "response_order" in survey flow to randomly have value of "reversed" half the time | |
// Add the following JavaScript to the questions for which you want to flip the ordering (see here: https://www.qualtrics.com/support/survey-platform/edit-survey/question-options/add-javascript/). | |
// This is a (very) minor variation on: http://stackoverflow.com/a/30766022 | |
// It allows all response scales to increase/decrease in the same direction for a given respondent, but avoids response order bias. | |
Qualtrics.SurveyEngine.addOnload(function() { | |
var r_order = "${e://Field/response_order}" | |
if(r_order == "reversed") { | |
var qid = this.questionId; | |
var choices = $(qid).select('li.Selection'); |