end of flash is end of scriptingrt

Chrome, Mozilla, and Safari have indicated that support for Flash will end soon. I have been feeling uncomfortable with the idea of requiring participants to download Flash applications for a while already. I myself don’t like to open them, and have Flash de-activated by default.

We have used the QRT Engine for a while, and since its recent retirement, started to develop in jsPsych.

small bug in scriptingrt

it’s only a small bug, but it still cost me a while to track this down: when you set up a testpart, scriptingrt apparently gets mightily confused if you assign the same keys to both positive and negative response. E.g., positive=”keyboard.space.release” negative=”keyboard.I.release”. In my case, this prevented the following TestPart to be presented. Weird and surprising. So don’t do this.

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.

problem with setting some attributes by scripts in ScriptingRT

When we write ScriptingRT experiments with between participant manipulations, we want to put as much as possible in scripts, so that we don’t have to create separate versions.

This works well with some attributes. For instance, you can change the contents of a text of a <Text/> at runtime:

After defining the item,

<Item id="p1" type="-"> 
  <Frame>
    <mx:Text id="p1upt" verticalCenter="+150" horizontalCenter="0" text="?"/> 
  </Frame> 
</Item> 
<fx:Script>
 <![CDATA[
  private function initVars():void {
    p1upt.text = "kite";
  }
]]>
</fx:Script>

This also works for attributes like instruction of an <Instruction/>

However, it does not work when I try to change the attributes positive and negative of a <Testpart/>. I am not sure why this doesn’t work, presumably because this is used to build the item data structure before the item is evaluated at runtime.

 

restriction of scriptingRT

We checked whether scriptingRT can be used to run studies that want to distinguish between more than 2 answers with a keyboard. Unfortunately, that is not the case. So, you can program a Stroop task where people have to distinguish between two colors, and press one of two keys. However, you cannot program a Stroop task where people have to distinguish between four colors, and press one of four keys. More precisely, you can, but the protocol cannot list the actual responses, only whether the answer was positive or negative, which are only two categories.

This comes out of our starting point, DMDX, where the behavior is the similar.

We can certainly change this at some point, and allow saving the actual response in the protocol, but it depends on having programming ressources to do so. For the time being, this is a restriction.

 

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.

counterbalancing in scriptingRT, and new version 0352

here is a demo how to counterbalance block order in scriptingRT.

in this example, there are two blocks of items, one instruction in the beginning, and one break between the blocks.

branching is used to influence the order of blocks. I leave the next attributes initially empty, and then fill them depending on the random number.

to do this, I had to add a new property that can be accessed by the branching operations, namely items.total. This brings us to a new version of scriptingRT0352.swc

this demonstrates the power of changing attributes at runtime. you can do this to everything that has an id. I also show this here by changing the feedbacktext.text to give feedback of overall performance in the break.

counterbalancing.htmlcounterbalancing.swfcounterbalancing.mxml

new version of the source was uploaded to github