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”

VBA code for creating text files based on data fields

I needed to create a lot of text files that were similar to one another except they were altered depending on a simple database. It would be something like an old-school MS Word “mail merge,” except it would create separate text files. I wanted an easy-to-use tool, so I put together something in Excel using VBA. The tool could create thousands of text files that vary on (up to) 15 different fields (i.e., dimensions). For example, this tool could create many HTML files that are all alike except for a product description, a photo, and a URL link. My original purpose for creating the tool was to setup the coarse-grained parallelization of a CPU-intensive Monte Carlo simulation.
Continue reading “VBA code for creating text files based on data fields”

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”