Group: Administrators
Posts: 13K,
Visits: 104K
|
This example summarizes where we are and puts the various pieces so far together.
<values> / targetpos = 0 / targetx = 0 / targety = 0
/ d1pos = 0 / d1x = 0 / d1y = 0
/ d2pos = 0 / d2x = 0 / d2y = 0
/ d3pos = 0 / d3x = 0 / d3y = 0
/ d4pos = 0 / d4x = 0 / d4y = 0
/ d5pos = 0 / d5x = 0 / d5y = 0
/ d6pos = 0 / d6x = 0 / d6y = 0
/ d7pos = 0 / d7x = 0 / d7y = 0
/ d8pos = 0 / d8x = 0 / d8y = 0
/ d9pos = 0 / d9x = 0 / d9y = 0
/ d10pos = 0 / d10x = 0 / d10y = 0
/ d11pos = 0 / d11x = 0 / d11y = 0
/ jitterstep = 1% </values>
<expt> / onexptbegin = [list.targetpositionsnew.appenditem(list.allpositions.nextindex); list.targetpositionsnew.appenditem(list.allpositions.nextindex); list.targetpositionsnew.appenditem(list.allpositions.nextindex); list.targetpositionsnew.appenditem(list.allpositions.nextindex); list.targetpositionsnew.appenditem(list.allpositions.nextindex); list.targetpositionsnew.appenditem(list.allpositions.nextindex); list.targetpositionsnew.appenditem(list.allpositions.nextindex); list.targetpositionsnew.appenditem(list.allpositions.nextindex); list.targetpositionsnew.appenditem(list.allpositions.nextindex); list.targetpositionsnew.appenditem(list.allpositions.nextindex); list.targetpositionsnew.appenditem(list.allpositions.nextindex); list.targetpositionsnew.appenditem(list.allpositions.nextindex); ] / blocks = [1-4 = taskblock] </expt>
<page blockstartpage> ^start of new block </page>
<block taskblock> / preinstructions = (blockstartpage) / trials = [1-12=newtrial] </block>
<trial newtrial> / ontrialbegin = [list.distractorpositionsnew.reset(); text.target.textcolor=red; ] / ontrialbegin = [values.targetpos=list.targetpositionsnew.nextvalue; values.targetx=list.x.item(values.targetpos)+(values.jitterstep*list.randomjitter.nextvalue); values.targety=list.y.item(values.targetpos)+(values.jitterstep*list.randomjitter.nextvalue);
values.d1pos=list.distractorpositionsnew.nextvalue; values.d1x=list.x.item(values.d1pos)+(values.jitterstep*list.randomjitter.nextvalue); values.d1y=list.y.item(values.d1pos)+(values.jitterstep*list.randomjitter.nextvalue);
values.d2pos=list.distractorpositionsnew.nextvalue; values.d2x=list.x.item(values.d2pos)+(values.jitterstep*list.randomjitter.nextvalue); values.d2y=list.y.item(values.d2pos)+(values.jitterstep*list.randomjitter.nextvalue);
values.d3pos=list.distractorpositionsnew.nextvalue; values.d3x=list.x.item(values.d3pos)+(values.jitterstep*list.randomjitter.nextvalue); values.d3y=list.y.item(values.d3pos)+(values.jitterstep*list.randomjitter.nextvalue); values.d4pos=list.distractorpositionsnew.nextvalue; values.d4x=list.x.item(values.d4pos)+(values.jitterstep*list.randomjitter.nextvalue); values.d4y=list.y.item(values.d4pos)+(values.jitterstep*list.randomjitter.nextvalue);
values.d5pos=list.distractorpositionsnew.nextvalue; values.d5x=list.x.item(values.d5pos)+(values.jitterstep*list.randomjitter.nextvalue); values.d5y=list.y.item(values.d5pos)+(values.jitterstep*list.randomjitter.nextvalue);
values.d6pos=list.distractorpositionsnew.nextvalue; values.d6x=list.x.item(values.d6pos)+(values.jitterstep*list.randomjitter.nextvalue); values.d6y=list.y.item(values.d6pos)+(values.jitterstep*list.randomjitter.nextvalue);
values.d7pos=list.distractorpositionsnew.nextvalue; values.d7x=list.x.item(values.d7pos)+(values.jitterstep*list.randomjitter.nextvalue); values.d7y=list.y.item(values.d7pos)+(values.jitterstep*list.randomjitter.nextvalue);
values.d8pos=list.distractorpositionsnew.nextvalue; values.d8x=list.x.item(values.d8pos)+(values.jitterstep*list.randomjitter.nextvalue); values.d8y=list.y.item(values.d8pos)+(values.jitterstep*list.randomjitter.nextvalue);
values.d9pos=list.distractorpositionsnew.nextvalue; values.d9x=list.x.item(values.d9pos)+(values.jitterstep*list.randomjitter.nextvalue); values.d9y=list.y.item(values.d9pos)+(values.jitterstep*list.randomjitter.nextvalue);
values.d10pos=list.distractorpositionsnew.nextvalue; values.d10x=list.x.item(values.d10pos)+(values.jitterstep*list.randomjitter.nextvalue); values.d10y=list.y.item(values.d10pos)+(values.jitterstep*list.randomjitter.nextvalue);
values.d11pos=list.distractorpositionsnew.nextvalue; values.d11x=list.x.item(values.d11pos)+(values.jitterstep*list.randomjitter.nextvalue); values.d11y=list.y.item(values.d11pos)+(values.jitterstep*list.randomjitter.nextvalue); ] / pretrialpause = 500 / stimulusframes = [1=target,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11] / validresponse = (57) </trial>
<text target> / items = ("T1", "T2") / hposition = values.targetx / vposition = values.targety </text>
<text d1> / items = distractoritems / hposition = values.d1x / vposition = values.d1y </text>
<text d2> / items = distractoritems / hposition = values.d2x / vposition = values.d2y </text>
<text d3> / items = distractoritems / hposition = values.d3x / vposition = values.d3y </text>
<text d4> / items = distractoritems / hposition = values.d4x / vposition = values.d4y </text>
<text d5> / items = distractoritems / hposition = values.d5x / vposition = values.d5y </text>
<text d6> / items = distractoritems / hposition = values.d6x / vposition = values.d6y </text>
<text d7> / items = distractoritems / hposition = values.d7x / vposition = values.d7y </text>
<text d8> / items = distractoritems / hposition = values.d8x / vposition = values.d8y </text>
<text d9> / items = distractoritems / hposition = values.d9x / vposition = values.d9y </text>
<text d10> / items = distractoritems / hposition = values.d10x / vposition = values.d10y </text>
<text d11> / items = distractoritems / hposition = values.d11x / vposition = values.d11y </text>
<item distractoritems> / 1 = "L1" / 2 = "L2" / 3 = "L3" / 4 = "L4" </item>
<list allpositions> / poolsize = 48 / selectionrate = always </list>
<list targetpositionsnew> </list>
<list distractorpositionsnew> / items = (1,2,3,4,5,6,7,8, 9,10,11,12,13,14,15,16, 17,18,19,20,21,22,23,24, 25,26,27,28,29,30,31,32, 33,34,35,36,37,38,39,40, 41,42,43,44,45,46,47,48) / not = (values.targetpos) / selectionrate = always </list>
<list randomjitter> / items = (-3,-2,-1, 1, 2, 3) / selectionrate = always / selectionmode = random / replace = true </list>
<list x> / items = (6.25%, 18.75%, 31.25%, 43.75%, 56.25%, 68.75%, 81.25%, 93.75%, 6.25%, 18.75%, 31.25%, 43.75%, 56.25%, 68.75%, 81.25%, 93.75%, 6.25%, 18.75%, 31.25%, 43.75%, 56.25%, 68.75%, 81.25%, 93.75%, 6.25%, 18.75%, 31.25%, 43.75%, 56.25%, 68.75%, 81.25%, 93.75%, 6.25%, 18.75%, 31.25%, 43.75%, 56.25%, 68.75%, 81.25%, 93.75%, 6.25%, 18.75%, 31.25%, 43.75%, 56.25%, 68.75%, 81.25%, 93.75%) </list>
<list y> / items = (8.33%, 8.33%, 8.33%, 8.33%, 8.33%, 8.33%, 8.33%, 8.33%, 25.00%, 25.00%, 25.00%, 25.00%, 25.00%, 25.00%, 25.00%, 25.00%, 41.67%, 41.67%, 41.67%, 41.67%, 41.67%, 41.67%, 41.67%, 41.67%, 58.33%, 58.33%, 58.33%, 58.33%, 58.33%, 58.33%, 58.33%, 58.33%, 75.00%, 75.00%, 75.00%, 75.00%, 75.00%, 75.00%, 75.00%, 75.00%, 91.67%, 91.67%, 91.67%, 91.67%, 91.67%, 91.67%, 91.67%, 91.67%) </list>
Please work through that and make sure you understand every part of it. If there's something you don't understand, please don't hesitate to ask about those specific portions of the code. A good exercise would be to comment the code, i.e., write up short explanations of what each part does.
Then start thinking about how to tackle the "old" trials. I.e., what additional steps have to be taken to assemble those configurations.
Hope this helps.
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
#1: The appenditem() function appends an item to the specified list. So, if the list is empty in the begining, the 1st time you apply that function, the respective item will be the 1st in the formerly empty list. The next time you apply it, it adds another item (then 2nd) and so forth. The items that are added come from list.allitems in the example. A random index number (nextindex; here between 1 and 6) is sampled from list.allitems and added to list.sourceitmes. That's what
list.sourceitems.appenditem(list.allitems.nextindex)
does in the example. For details on list properties and functions, see the language reference entry for the <list> element in the documentation.
#2: Yes, you need to work with more items, of course. You have 48 positions. As per previous examples, you can simply number them 1 to 48. You want to select 12 of those 48 at random and add them to one list (= target positions to be used in "new" trials), and another 12 at random to another list (=target positions to be used in "old" trials). How that works -- sampling from a "master" list at random, and adding the sampled items to (a) different list(s) -- is what the example covers.
#3: As per #2, the /poolsize would be 48.
#4: Yes, you need several lists. Exactly how many is a matter of various design decisions. Again, as per #2, you definitely need - one list for "old" target positions (12 items will end up in that list), - one list for "new" target positions (another 12 items will end up there), - one or several lists that store the set of distractor positions associated with a given target position in "old" trials.
Leave aside the "old" trials for now. Start with setting up the "new" trials. I.e., from the list that holds your total set of 48 positions, select 12 at random / add them to a list. Sample target positions from that list in "new" trials, while distributing the distractors randomly as per previous examples.
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
The previous work in the <trial> is *not* obsolete.
At the beginning of the experiment you'll want to to construct, "fill" or assemble the lists that the respective <trial> elements then *later during* the experiment sample from.
The 12 target posititions you'll be using for the "new" trials, for example, are *not known* beforehand. Hence you cannot just hardcode 12 specific positions in a list somewhere.
Instead, you need to 1st randomly *select* those 12 positions from the total of 48 positions and store those in a list. That list then is where your "new" trials sample their target positions from.
Hope this clarifies.
One further tip: Before you start thinking about writing any code, try to imagine how you would do things in the real world with physical objects. Imagine your grid / set of 48 positions as a deck of 48 cards. Then proceed to draw 12 random cards and put them in a deck labeled "target new", etc. I find that thinking about matters of random selection in this way helps.
|