Millisecond Forums

Arrays?

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

By nashby - 7/16/2013

I am trying to figure out how to have trials presented randomly but not having to define every single trial before hand. Basically I have 20 choices that participants must make between two options. I want these choices presented in random order and only once.


If I were programming this in anything else (presentation, realbasic, etc...)  I would simply define an array like


Array X = (10, 20, 30, 40, 50, 60, 70, 80, 90, 100)


I would then shuffle array X so it is in random order and then work through replacing the parts needed with something like replace item = ArrayX[ n ] where n is a value that increases with each trial.


I dont see such a framework being possible in Inquisit in a straightforward way. Any thoughts on how to implement this?

By Dave - 7/16/2013

I am trying to figure out how to have trials presented randomly but not having to define every single trial before hand. Basically I have 20 choices that participants must make between two options. I want these choices presented in random order and only once.


This can be easily achieved with a single <trial> element, sampling determined by the stimulus elements it presents. Not sure why one would need an array construct here.


However, <list> or <counter> elements offer much the same functionality as classic arrays, in case you really need that.

By nashby - 7/16/2013

Perhaps its just my way of thinking after programming for so long using other formats. But my current employers want to use Inquisit as its simpler for a lot of the people in the labs to put together their experiments but it seems to lack a lot of programming freedom other systems have. 


I dont understand how I could do this with a single trial. I looked at list and it looks like it might work so I will give it a shot. 

By Dave - 7/16/2013

Studying a few of the more complex scripts in the Task Library might prove worthwhile, such as Information Sampling Task, Tower of London, Columbia Card Task. You will find that traditional programming techniques apply to Inquisit syntax as well.

By chydock - 6/3/2014

Related to this, I want to randomly select two attributes of a trial: a correct response and a stimulus, but the two are paired, i.e. each stimulus has a unique correct response. 

I was considering the array method discussed earlier in this string, but would like to know if this can be done in a simpler way.

Thanks for the help,
Chris
  

By Dave - 6/3/2014

Chris,

this can be done in a variety of ways. For starters, you'll want to consult the documentation / language reference for the <trial> element's /iscorrectresponse attribute as well as the "How to display stimulus pairs" topic in the documentation's how-to section. (Whether you pair two stimuli or a stimulus and "response" ultimately boils down to much the same thing.) You can also find numerous concrete examples via the forum's search facilities, e.g. https://www.millisecond.com/forums/FindPost6215.aspx or https://www.millisecond.com/forums/FindPost13201.aspx