Wednesday, April 30, 2008

flash (n)back

The PNAS article linked here found subjects could improve IQ with training. I've written a simple flash version of their protocol over a couple long evenings in haxe/flash.

The article methods list 2 stimuli, a moving box, and spoken letters. The test subject is to respond (click in my case) when the box position or the spoken letter is the same as it was 2 time steps ago. Where 2 is increased as the subject gets better. I didn't do sound, I just show a big letter. Clearly, the logical thing to do is use it for a couple weeks and then implement the sound when I'm smarter. (I've never really used swfmill, but I think that'd be useful here...)

The article is ambiguous about when the letter is to sound, I've made both the letter and the box appear at the same time. The default, as in the article is to have 3 seconds between events, and to show the box for 0.5 seconds. I also add some indication of whether the answer was correct (green +) or not (red -). That actually makes things more difficult as its distracting to see something new flash on the screen. It also keeps a running total of misses (didn't click when should have), correct, and incorrect (clicked when shouldn't have). The grid size is set at 3 * 3 as that's more than difficult enough for me, and it appears to be what they used in the article. It actually only has 8 positions as I use the center to display the letter. Another ambiguity from the article is the number of letters. I use 3. That's easily changeable in the code.

The length of the time step (time_step, 3000ms default), the amount of time to show the box and text (show_time, 500ms default) and the number of steps back (nback, 2 default) are settable via the url so the default equates to:
?time_step=3000&nback=2&show_time=500

Observations

1. It's freakin hard. I'm suck at it.
2. Haxe is nice, but jeez, I write ugly actionscript.
3. I like quick, pointless evening projects like this where I have a clear idea of the outcome. It's good for learning.
4. Whatever points there are against flash, it's easy to uh, "deploy".


Here's a live version of the app (untested in IE, but swfobject should do it's thing). Just click in the flash movie when there's something that's the same as 2 time-steps ago.
You can make it arbitrarily hard by sending in parameters on the url, see the links in the page for examples.

And here's the code. Get it from svn via:
svn co http://bpgeo.googlecode.com/svn/trunk/nback

No comments: