Millisecond Forums

Visual Search Task Programming?

https://forums.millisecond.com/Topic4812.aspx

By allison - 7/30/2010

Hi All,


Has anybody ever programmed a visual search task through Inquisit? Basically, I need to create 130 trials, each of which presents a 4x4 matrix of insect pictures, and participants are required to indicate whether there is an odd-one-out (e.g., spider among dragonflies). I have several different matrix types, and would like to be able to randomize which type of stimulus appears in each matrix slot, which stimulus from that type appears, and where each appears. Additionally, I would like to ensure that no picture appears twice in a single matrix. Obviously, I am trying to avoid creating 130 different matrices, saving as jpegs, and then randomizing their appearance. Just wondering if anybody has done anything similar and can offer some tips.


Thanks!


-Allison

By alex_t - 8/2/2010

All this should be possible using counters. I've coded up something similar--the file is available in a thread I posted right above this one. Fee free to pick through that if you're not sure how to start.

By allison - 8/6/2010

Thanks Alex! That should be really helpful.

By allison - 8/13/2010

Ok - So I've done my best to put the VST script together, but I'm having a lot of trouble. Basically, after correcting all the initial errors, the script won't run. The screen flickers for a second, but other than that, nothing happens.


I've attached the script in case anybody can poke through it and figure out what I'm doing wrong. I think I'm a bit out of my element here (no pun intended).


I'm trying to present 130 trials of 4x4 matrices of insect pictures (16 simultaneous pictures). This is basically an "odd-one-out" task, where respondents are required to press a "yes" key if there is an odd-one-out (e.g., a spider among butterflies) or a "no" key if all 16 pictures are from the same insect category (e.g., all 16 beetles). I've used counters to define location (in terms of horizontal and verical percentage), and then "attached" these to the pictures themselves, using the "values" element. I've also used counters to try to link the target (i.e., odd-one-out) with the distractors, so that their position and presentation sequence is randomized. I've been using other people's scripts (yours, Alex, and the California Card Sort Task that's in the Inquisit library) to try to muddle through this, but I'm now pretty stuck. Any help people can offer would be much appreciated. Also - I'm new to the forums, so please let me know if you need other information, pictures, etc.


Thanks!

By Dave - 8/13/2010

Hi Allison,


no attachment to be found here, but that's a good thing in this case 'cause it'll allow me to editorialize (my favorite acrivity):


Any help people can offer would be much appreciated. Also - I'm new to the forums, so please let me know if you need other information, pictures, etc.


Good call! It's generally advisable to


- Provide a *simplified* version of the script you're having problems with (less trials, less items, etc.). Just enough to showcase the general idea and the issues you're having. That makes things easier for others to grasp and spot problems. Also, more people will be willing to give a short snippet a look rather than some full-blown, 1000 lines of code monstrosity.


- Give people something they can actually run. I.e. always include the necessary supporting files (pictures, etc.) with your script. Just zip everything up and attach it to your post via the controls found on the 'Options' tab.


Thanks,


~Dave

By allison - 8/16/2010

Hi


The file along with the pictures is too large to upload here, but can be found here: http://www.megaupload.com/?d=AW96YM1I


I could not simplify the script because I believe the problems are stemming from the complexity of the image matrix. The script is seperated into sections to make it easier to jump through, and I think the problems are related to the counters.


In its current state, the script will not run because of an error related to one of the counters. By changing the /select attribute of the counter that is causing the error to no longer be linked to another counter I can get the script to run but it only provides a blank screen for under a second, and then closes the experiment.


If anybody can take a look and provide some advise that would be much appreciated.

By alex_t - 8/16/2010

Hi Allison, 


I'm a novice programmer myself, but when you say things like "could not simplify" and "complexity of the image matrix" it makes me think that the problems you're having (and believe me, I've had them too) are methodological just as much as they are technical.


One piece of advice I've gotten from experienced programmers time and time again is start a program by getting it to do the simplest thing that you want it to do, and then to work your way up from there in baby steps. Similarly, if you think there's something wrong with your core algorithm, you're going to want to create an 'outline' version of your experiment, that is as simple and easy to follow as possible. If you can get that to work, then it's just a matter of making small additions to it until you get to your full experiment.


It's just not practical to try and debug long, complicated files of code.

By Dave - 8/16/2010

@Alex


Normally I'm the grumpy forum guy telling people to step back and reassess their problem, break it down into smaller sub-problems, start simple and then extend step by step, etc. I can't thank you enough for taking this burden off my shoulders for once!


@Allison


I can only reaffirm and extend on what Alex already said:


- Become familiar with the tools you're using (i.e. Inquisit) before doing any serious, complex work with them.


- Decompose the general problem into smaller sub-problems & solve each one independently. Once you've done so, combine the single solutions into a general solution.


- Start small & simple, scale up later.


Good luck,


~Dave