scriptingrt and mturk

I got a question by email and thought it would be best answered by a post:

First, is MTurk the most popular avenue for ScriptingRT?  Or is there another/better platform of access?

Mturk is definitely the best way to recruit participants quickly, and the data quality is reasonable. We also used facebook to spread a link to studies, but it is usually much slower. But note that we always use another platform, Qualtrics, to build a questionnaire around the scriptingRT. I guess it would be possible to embed a scripingRT file directly in a Mturk task, but I never tried that.

Also, is it possible to use either ScriptingRT or MTurk to create a design where a worker must complete several tasks (eg reading three sets of sentences over a span of 3-5 days) before being paid?

I guess yes. You could create one Mturk task that would have such a long duration. Alternatively, you could create one Mturk task for the first measurement point, and then invite your workers to do the second and third measurement points, stepping up the payment if they also participate a second and a third time.

embedding scriptingrt in qualtrics in chrome

In earlier posts and the manual we described how to embed scriptingrt files in qualtrics.

There is now a problem with this. Qualtrics serves its pages using secure http, or https. However, when you put your own flash files and the swfobject javascript library on your server, these servers will usually be regular http. Until recently, that was not a problem, but as of recently, Chrome bulks at this combination: When it displays a http website, it will not include anymore “unsafe”, regular http content. You recognize this when the small silver shield appears in the address bar. Or you can open the developer console, where you see the error message.

As a result, your flash file is not shown in Chrome. At the moment, Firefox and IE will still show it, but that might go away soon as well.

The solution is to serve your content from a secure http server as well.

Unfortunately, it is not cheap. My service provider charges over 70 € per year for a registered SSL certificate, and nothing else will do. However, there is a workaround: You can put your files in a your dropbox. Both links in the “public” dropbox folder and “share links” seem to come from https by default.

I quickly tested this last week, it seems to work. Also, it seems to work that these dropbox-served flash files then send their data to a php script on a regular (non https) server.

If that doesn’t work for you, please comment below.

In principle, though, dropbox-served files will probably load more slowly. So it might be a good idea to either get access to your institution’s https server, or to upgrade your own.

UPDATE 11/10/2013: it seems that is not a problem anymore? At least in a first test today, it was possible again to include non-https-served flash files in qualtrics.

passing info to scriptingrt

when embedding a scriptingrt swf in a web page, it is possible to pass information from the html page to the flash swf in the form of flashvars (see Flashvars on the examples page).

however, we noticed some problems when embedding a swf in a qualtrics page – the swf seemed to loose focus, or at least it was sometimes hard to give the focus back to it after clicking somewhere else. As an alternative, we decided to test opening the swf in a separate window directly, without embedding it in a html wrapper. Question is, can you then still transfer info to it?

Turns out you can. This swf displays 4 trials. Two of them are taken from flashvars, and we pass them here appended after the file name in the link, with “…flashvars.swf?myFirstName=thomas&myLastName=schubert” target=”_blank” (opening in a new window). If you change those values, you get different trials.

using videos on qualtrics

how to use a video in a qualtrics survey (easy & lazy version)

– upload your video to youtube. adjust the privacy and other settings (e.g., unlisted, don’t allow comments)

– change the name to something appropriate, it will be displayed when the video starts

– click on Embed, adjust the settings (size, turn off video suggestions at the end), and then copy the code, something like

iframe width="640" height="480" src="" frameborder="0" allowfullscreen  /iframe

(but with brackets before and after, which I took out here, otherwise you would see the video and not the link)

– in your qualtrics survey, create a text/graphic item, edit it, click on html view, and paste the iframe line above.

– done, it will look something like this:


to specify a beginning and an end, add start:xx&end=yy after the ? in the link, like in the example, with xx and yy being seconds of the video.

The rel=0 gets rid of video suggestions at the end.



Update 18.06.14:

some people commented recently that there are problems with embedding video this way.

We are currently using a different method, and it works flawlessly. Perhaps that works for others as well. We use the youtube API, which embeds videos via javascript. In your item, switch to HTML view, and paste this code:

<div id="ytplayer">&nbsp;</div>
 // Load the IFrame Player API code asynchronously.
 var tag = document.createElement('script');
 tag.src = "";
 var firstScriptTag = document.getElementsByTagName('script')[0];
 firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);

 // Replace the 'ytplayer' element with an <iframe> and
 // YouTube player after the API code downloads.
 var player;
 function onYouTubePlayerAPIReady() {
 player = new YT.Player('ytplayer', {
 playerVars: {'disablekb': 1,'modestbranding': 1,'autoplay': 1,'autohide': 1,'fs': 0,'iv_load_policy': 3,'showinfo': 0,'rel': 0}, 
 height: '390',
 width: '640',
 videoId: 'y6Sxv-sUYtM' 

to put in your own video, replace the videoid with the one of your video; you’ll get see it at the end of the URL when you watch a video on youtube.

You will not see anything on this when you switch from HTML view back to normal view, but the video should be there if you preview the question.

The youtube player API used here is well documented.


setting an embedded data with javascript instead of a web service in qualtrics

qualtrics’ web service was a bit unreliable during the last days. It’s a problem because we use it to connect qualtrics and mturk. qualtrics support suggested to use javascript instead, in particular the Qualtrics.SurveyEngine.setEmbeddedData() function. It works nice, and I set up an example how it works.

so, if you have trouble with the random number generator, just stick this javascript in the first question (but AFTER the embedded data field has been created). Note that it takes one page break to actually update the value (see the example).