In Qualtrics, using JavaScript with embedded data and survey responses

Qualtrics allows JavaScript in the survey questions.  However, when reading and writing embedded data based on survey responses using JavaScript, the syntax is a little weird.  This post walks through an example of using JavaScript to …
(1) read embedded data (strings and numbers)
(2) accept survey responses, and
(3) change the embedded data based on the survey responses (i.e., conditional processing).
Continue reading “In Qualtrics, using JavaScript with embedded data and survey responses”

Ruby, JavaScript, and Perl code for using Mechanical Turk’s APIs

The Ruby, JavaScript, and Perl files I have posted below may be useful to someone who wants to access MTurk’s APIs to create HITs.  Basic tasks (e.g., creating a HIT) and intermediate tasks (giving a “bonus” to a worker) can be accomplished easily by using Amazon’s web interface.  Advanced tasks (e.g., sending e-mail notifications to a long list of workers who have completed your previous HITs) cannot be accomplished with the web interface.  There is a striking contrast between the ease of doing tasks with the web interface and the difficulty of doing tasks with the API.  That difference is akin to the difference between buying a car and building a car entirely from custom parts.  Continue reading “Ruby, JavaScript, and Perl code for using Mechanical Turk’s APIs”

Generating Footnotes in Bluebook Format for Law Review Manuscripts

When writing for a law review, I like to submit a manuscript with reasonably polished footnotes. I’ll probably never get the footnotes 100% accurate; there are too many “dusty corners” in the bluebook citation system for that. But I try to get the basics correct. To help me do that, I’ve created an online tool for generating footnotes in Bluebook format.
Continue reading “Generating Footnotes in Bluebook Format for Law Review Manuscripts”

JavaScript for Customized Qualtrics Questions

Years ago, I wrote my online questionnaires from scratch with client-side JavaScript and Perl.  Nowadays, I’ve moved almost entirely to Qualtrics.  Creating and managing online questionnaires with Qualtrics is so easy that I’ve been spoiled by it.

However, I had a task I couldn’t accomplish with the typical question types, so I wrote a JavaScript solution for customizing Qualtrics questions.  I’m posting the solution here in case it’s useful to other people.  This mock-up questionnaire is an example of the sort of customized questions that could be created. The basic approach I describe below is straightforward, so you could adapt my JavaScript code to your favorite web programming language. Continue reading “JavaScript for Customized Qualtrics Questions”

Javascript for Qualtrics: performing mathematical operations on quantitative responses

In Qualtrics, I needed to take a quantitative survey response, do some mathematical operations to the response, and then (1) display the output to the survey respondent and (2) write the output to the Qualtrics dataset. It turns out this is a little tricky, but as described in this post, Javascript can do this task nicely. Continue reading “Javascript for Qualtrics: performing mathematical operations on quantitative responses”

Javascript for Qualtrics to alter choice options

Here is some Javascript code for altering the current question’s multiple-choice options based on the respondent’s answer to a previous multiple-choice question. Specifically, this code considers the response given to a previous question and modifies the current question to remove any answer options that are lower than the previous response. [Note: I hard-coded the number of options as 10. If there are fewer than 10, it will not throw an error.]

Continue reading “Javascript for Qualtrics to alter choice options”