Hi!
So in my study, I am grouping stimuli into sets of three called triplets. One of the conditions is to present the images one by one in a certain order in the study phase. In the test phase, there are two types of trials. Target trials and Lure trials. In target trials, the images are presented in the original order as in the study phase. In lure trials, two of the images would have switched their order position. Here is my code for each of the trials types - encoding, retrieval target, and retrieval lure.
I am finding difficulty in randomly selecting one triplet from the encoding phase every time a new retrieval trial is presented. The same triplet is being presented for all retrieval trials. Please let me know where I'm going wrong with the coding.
**************************************************************************************************************
**************************************************************************************************************
PARAMETERS
**************************************************************************************************************
**************************************************************************************************************
<parameters>
/ stimsize = 17%
/ stimulusduration = 1000
/ probeduration = 2000
/ probeduritemtime = 3000
/ responsewindow = 60000
/ yesKey = "E"
/ noKey = "I"
</parameters>
**************************************************************************************************************
**************************************************************************************************************
STIMULI
**************************************************************************************************************
**************************************************************************************************************
<item allstims>
/1="1.jpg"
/2="2.jpg"
/3="3.jpg"
/4="4.jpg"
/5="5.jpg"
/6="6.jpg"
/7="7.jpg"
/8="8.jpg"
/9="9.jpg"
/10="10.jpg"
/11="11.jpg"
/12="12.jpg"
/13="13.jpg"
/14="14.jpg"
/15="15.jpg"
/16="16.jpg"
/17="17.jpg"
/18="18.jpg"
/19="19.jpg"
/20="20.jpg"
</item>
// i13 to 20 are the new stims, will not be used in the triplets presented
<list newstims>
/ items = (13,14,15,16,17,18,19,20)
/ selectionrate = always
</list>
<item fixationcross>
/1="fixation.png"
</item>
<picture fixation>
/ items = item.fixationcross
/ position = (50%, 50%)
/ size = (40%,40%)
/ valign = center
/ halign = center
</picture>
<picture tripletimage>
/ items = item.allstims
/ select = values.tripletimage
/ size = (parameters.stimsize, parameters.stimsize)
</picture>
<picture orderpic1>
/ items = item.allstims
/ select = values.orderpic1
/ size = (parameters.stimsize, parameters.stimsize)
/ hposition = 50%
/ vposition = 50%
</picture>
<picture orderpic2>
/ items = item.allstims
/ select = values.orderpic2
/ size = (parameters.stimsize, parameters.stimsize)
/ hposition = 50%
/ vposition = 50%
</picture>
<picture orderpic3>
/ items = item.allstims
/ select = values.orderpic3
/ size = (parameters.stimsize, parameters.stimsize)
/ hposition = 50%
/ vposition = 50%
</picture>
<text yes>
/ items = ("YES")
/ position = (15%, 85%)
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/ size = (10%, 3%)
/ txcolor = black
</text>
<text no>
/ items = ("NO")
/ position = (85%, 85%)
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/ size = (10%, 3%)
/ txcolor = black
</text>
// Probe Questions //
<text itemtimequestion>
/ items = ("Same order?")
/ position = (50%, 40%)
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/ size = (30%, 15%)
/ txcolor = black
</text>
**************************************************************************************************************
**************************************************************************************************************
VALUES: automatically updated
**************************************************************************************************************
**************************************************************************************************************
<values>
/ tripletimage = 1
/ orderpic1 = 1
/ orderpic2 = 1
/ orderpic3 = 1
/ pic1x = 0%
/ pic2x = 0%
/ pic3x = 0%
/ pic1y = 0%
/ pic2y = 0%
/ pic3y = 0%
/ whichtriplet = 0
/ whichluretype = 0
/ responseCategory = ""
</values>
**************************************************************************************************************
**************************************************************************************************************
LISTS
**************************************************************************************************************
**************************************************************************************************************
<defaults>
/ canvasaspectratio = (1,1)
/ minimumversion = "6.5.1.0"
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/ txbgcolor = white
/ txcolor = black
/ screencolor = white
</defaults>
// list of locations for the encoding trials
<list xpos>
/ items = (25%, 75%, 50%)
/ replace = false
/ selectionrate = always
</list>
<list ypos>
/ items = (25%, 25%, 75%)
/ selectionmode = list.xpos.currentindex
/ selectionrate = always
</list>
// list of locations for the test/probe trials for order condition
<list orderxpos>
/ items = (50%, 50%, 50%)
/ replace = false
/ selectionrate = always
</list>
<list orderypos>
/ items = (50%, 50%, 50%)
/ replace = false
/ selectionrate = always
</list>
<list imagenumbers>
/ items = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
/ replace = false
/ resetinterval = 0
/ selectionrate = always
</list>
<list tripletnumbers>
/ selectionmode = sequence
/ selectionrate = always
</list>
<list tripletxpos>
/ selectionmode = sequence
/ selectionrate = always
</list>
<list tripletypos>
/ selectionmode = sequence
/ selectionrate = always
</list>
<list anytriplet>
/ items = (1,2,3,4)
/ replace = true
/ selectionrate = always
</list>
<list luretypes>
/ items = (1,2,3)
/ selectionrate = always
</list>
**************************************************************************************************************
**************************************************************************************************************
DATA
**************************************************************************************************************
**************************************************************************************************************
***********************
raw data file
***********************
<data>
/ columns = (build, computer.platform, date, time, subject, group, session,
blockcode, blocknum, trialcode, trialnum, stimulusnumber, stimulusitem, stimulusitem, stimulusitem, picture.tripletimage.hposition, picture.tripletimage.vposition,
parameters.stimulusduration, parameters.probeduration, parameters.probeduritemtime, expressions.canvasRatio, values.responseCategory, correct, latency,
values.whichtriplet,values.pic1, values.pic2, values.pic3,values.orderpic1, values.orderpic2, values.orderpic3, values.pic1x, values.pic1y, values.pic2x, values.pic2y, values.pic3x, values.pic3y,
)
</data>
<expressions>
/canvasRatio = (display.canvasheight/display.height)*100
</expressions>
**************************************************************************************************************
**************************************************************************************************************
TRIALS
**************************************************************************************************************
**************************************************************************************************************
<trial pairings>
/ ontrialbegin = [
//list.imagenumbers.reset();
list.tripletnumbers.reset();
list.tripletxpos.reset();
list.tripletypos.reset();
var i = 0;
while (i < 12){
i += 1;
list.tripletnumbers.appenditem(list.imagenumbers.nextvalue);
list.tripletxpos.appenditem(list.xpos.nextvalue);
list.tripletypos.appenditem(list.ypos.nextvalue);
};
]
/ recorddata = false
/ trialduration = 0
</trial>
<trial encodingfixation>
/ stimulustimes = [0=fixation]
/ timeout = parameters.stimulusduration
</trial>
<trial encodingimage>
/ ontrialbegin = [
values.tripletimage = list.tripletnumbers.nextvalue;
picture.tripletimage.hposition = list.tripletxpos.nextvalue;
picture.tripletimage.vposition = list.tripletypos.nextvalue;
]
/ stimulustimes = [0=picture.tripletimage]
/ timeout = parameters.stimulusduration
</trial>
// 1st triplet starts at 1
// 2nd triplet starts at 4
// 3rd triplet starts at 7
// 4th triplet starts at 10
<list tripletstart>
/ items = (1,4,7,10)
/ selectionrate = always
</list>
<list itemwithintriplet>
/ items = (0,1,2)
/ selectionrate = always
/ replace = true
</list>
// Item-Time Condition /////////////////////////////////////////////////////////////////////////////////////////////////////////
**Target trial**
<trial itemtimetarget>
/ ontrialbegin = [values.whichtriplet=list.anytriplet.currentvalue;]
/ ontrialbegin = [
list.tripletstart.reset()
values.pic1x = picture.orderpic1.hposition;
values.pic2x = picture.orderpic2.hposition;
values.pic3x = picture.orderpic3.hposition;
values.pic1y = picture.orderpic1.vposition;
values.pic2y = picture.orderpic2.vposition;
values.pic3y = picture.orderpic3.vposition;
// randomly select one of the presented triplets, select first item within that triplet, assign to orderpics
if(values.whichtriplet=1){
values.orderpic1 = list.tripletnumbers.item(list.tripletstart.item(1) + list.itemwithintriplet.item(1));
values.orderpic2 = list.tripletnumbers.item(list.tripletstart.item(1) + list.itemwithintriplet.item(2));
values.orderpic3 = list.tripletnumbers.item(list.tripletstart.item(1) + list.itemwithintriplet.item(3));
} elseif (values.whichtriplet=2){
values.orderpic1 = list.tripletnumbers.item(list.tripletstart.item(2) + list.itemwithintriplet.item(1));
values.orderpic2 = list.tripletnumbers.item(list.tripletstart.item(2) + list.itemwithintriplet.item(2));
values.orderpic3 = list.tripletnumbers.item(list.tripletstart.item(2) + list.itemwithintriplet.item(3));
} elseif (values.whichtriplet=3){
values.orderpic1 = list.tripletnumbers.item(list.tripletstart.item(3) + list.itemwithintriplet.item(1));
values.orderpic2 = list.tripletnumbers.item(list.tripletstart.item(3) + list.itemwithintriplet.item(2));
values.orderpic3 = list.tripletnumbers.item(list.tripletstart.item(3) + list.itemwithintriplet.item(3));
} elseif (values.whichtriplet=4){
values.orderpic1 = list.tripletnumbers.item(list.tripletstart.item(4) + list.itemwithintriplet.item(1));
values.orderpic2 = list.tripletnumbers.item(list.tripletstart.item(4) + list.itemwithintriplet.item(2));
values.orderpic3 = list.tripletnumbers.item(list.tripletstart.item(4) + list.itemwithintriplet.item(3));
block.encodingphase
}
]
/ stimulustimes = [0 = orderpic1; 1000 = clearscreen, orderpic2; 2000 = clearscreen, orderpic3; 3000 = clearscreen, itemtimequestion, yes, no]
/ beginresponsetime = parameters.probeduritemtime
/ response = timeout(parameters.responsewindow)
/ validresponse = (parameters.yesKey, parameters.nokey)
/ iscorrectresponse = [
return (
(trial.itemtimetarget.responsetext == parameters.yesKey) ||
(trial.itemtimetarget.responsetext == parameters.noKey));
]
</trial>
**Lure trial**
<trial itemtimelure>
/ ontrialbegin = [values.whichluretype=list.luretypes.currentvalue;]
/ ontrialbegin = [values.whichtriplet=list.anytriplet.currentvalue;]
/ ontrialbegin = [
list.tripletstart.reset()
values.pic1x = picture.orderpic1.hposition;
values.pic2x = picture.orderpic2.hposition;
values.pic3x = picture.orderpic3.hposition;
values.pic1y = picture.orderpic1.vposition;
values.pic2y = picture.orderpic2.vposition;
values.pic3y = picture.orderpic3.vposition;
//select a random triplet, select a random lure type (mixed order positions for two out of three images),
//assign to the orderpics
if(values.whichtriplet=1){
if (values.whichluretype=1){
values.orderpic1 = list.tripletnumbers.item(list.tripletstart.item(1) + list.itemwithintriplet.item(2));
values.orderpic2 = list.tripletnumbers.item(list.tripletstart.item(1) + list.itemwithintriplet.item(1));
values.orderpic3 = list.tripletnumbers.item(list.tripletstart.item(1) + list.itemwithintriplet.item(3));
}elseif (values.whichluretype=2){
values.orderpic1 = list.tripletnumbers.item(list.tripletstart.item(1) + list.itemwithintriplet.item(3));
values.orderpic2 = list.tripletnumbers.item(list.tripletstart.item(1) + list.itemwithintriplet.item(2));
values.orderpic3 = list.tripletnumbers.item(list.tripletstart.item(1) + list.itemwithintriplet.item(1));
}elseif(values.whichluretype=3){
values.orderpic1 = list.tripletnumbers.item(list.tripletstart.item(1) + list.itemwithintriplet.item(1));
values.orderpic2 = list.tripletnumbers.item(list.tripletstart.item(1) + list.itemwithintriplet.item(3));
values.orderpic3 = list.tripletnumbers.item(list.tripletstart.item(1) + list.itemwithintriplet.item(2));
}
} elseif (values.whichtriplet=2){
if (values.whichluretype=1){
values.orderpic1 = list.tripletnumbers.item(list.tripletstart.item(2) + list.itemwithintriplet.item(2));
values.orderpic2 = list.tripletnumbers.item(list.tripletstart.item(2) + list.itemwithintriplet.item(1));
values.orderpic3 = list.tripletnumbers.item(list.tripletstart.item(2) + list.itemwithintriplet.item(3));
}elseif (values.whichluretype=2){
values.orderpic1 = list.tripletnumbers.item(list.tripletstart.item(2) + list.itemwithintriplet.item(3));
values.orderpic2 = list.tripletnumbers.item(list.tripletstart.item(2) + list.itemwithintriplet.item(2));
values.orderpic3 = list.tripletnumbers.item(list.tripletstart.item(2) + list.itemwithintriplet.item(1));
}elseif(values.whichluretype=3){
values.orderpic1 = list.tripletnumbers.item(list.tripletstart.item(2) + list.itemwithintriplet.item(1));
values.orderpic2 = list.tripletnumbers.item(list.tripletstart.item(2) + list.itemwithintriplet.item(3));
values.orderpic3 = list.tripletnumbers.item(list.tripletstart.item(2) + list.itemwithintriplet.item(2));
}
} elseif (values.whichtriplet=3){
if (values.whichluretype=1){
values.orderpic1 = list.tripletnumbers.item(list.tripletstart.item(3) + list.itemwithintriplet.item(2));
values.orderpic2 = list.tripletnumbers.item(list.tripletstart.item(3) + list.itemwithintriplet.item(1));
values.orderpic3 = list.tripletnumbers.item(list.tripletstart.item(3) + list.itemwithintriplet.item(3));
}elseif (values.whichluretype=2){
values.orderpic1 = list.tripletnumbers.item(list.tripletstart.item(3) + list.itemwithintriplet.item(3));
values.orderpic2 = list.tripletnumbers.item(list.tripletstart.item(3) + list.itemwithintriplet.item(2));
values.orderpic3 = list.tripletnumbers.item(list.tripletstart.item(3) + list.itemwithintriplet.item(1));
}elseif(values.whichluretype=3){
values.orderpic1 = list.tripletnumbers.item(list.tripletstart.item(3) + list.itemwithintriplet.item(1));
values.orderpic2 = list.tripletnumbers.item(list.tripletstart.item(3) + list.itemwithintriplet.item(3));
values.orderpic3 = list.tripletnumbers.item(list.tripletstart.item(3) + list.itemwithintriplet.item(2));
}
} elseif (values.whichtriplet=4){
if (values.whichluretype=1){
values.orderpic1 = list.tripletnumbers.item(list.tripletstart.item(4) + list.itemwithintriplet.item(2));
values.orderpic2 = list.tripletnumbers.item(list.tripletstart.item(4) + list.itemwithintriplet.item(1));
values.orderpic3 = list.tripletnumbers.item(list.tripletstart.item(4) + list.itemwithintriplet.item(3));
}elseif (values.whichluretype=2){
values.orderpic1 = list.tripletnumbers.item(list.tripletstart.item(4) + list.itemwithintriplet.item(3));
values.orderpic2 = list.tripletnumbers.item(list.tripletstart.item(4) + list.itemwithintriplet.item(2));
values.orderpic3 = list.tripletnumbers.item(list.tripletstart.item(4) + list.itemwithintriplet.item(1));
}elseif(values.whichluretype=3){
values.orderpic1 = list.tripletnumbers.item(list.tripletstart.item(4) + list.itemwithintriplet.item(1));
values.orderpic2 = list.tripletnumbers.item(list.tripletstart.item(4) + list.itemwithintriplet.item(3));
values.orderpic3 = list.tripletnumbers.item(list.tripletstart.item(4) + list.itemwithintriplet.item(2));
}
}
]
/ stimulustimes = [0 = orderpic1; 1000 = clearscreen, orderpic2; 2000 = clearscreen, orderpic3; 3000 = clearscreen, itemtimequestion, yes, no]
/ beginresponsetime = parameters.probeduritemtime
/ response = timeout(parameters.responsewindow)
/ validresponse = (parameters.yesKey, parameters.nokey)
/ iscorrectresponse = [
return (
(trial.itemtimetarget.responsetext == parameters.yesKey) ||
(trial.itemtimetarget.responsetext == parameters.noKey));
]
/ ontrialend = [
list.anytriplet.reset()
list.luretypes.reset()
]
</trial>
**************************************************************************************************************
**************************************************************************************************************
BLOCKS
**************************************************************************************************************
**************************************************************************************************************
<block pairings>
/ trials = [1 = pairings]
</block>
<block encodingphase>
/ trials = [
1 = encodingfixation; 2 = encodingimage; 3 = encodingimage; 4 = encodingimage;
5 = encodingfixation; 6 = encodingimage; 7 = encodingimage; 8 = encodingimage;
9 = encodingfixation; 10 = encodingimage; 11 = encodingimage; 12 = encodingimage;
13 = encodingfixation; 14 = encodingimage; 15 = encodingimage; 16 = encodingimage;
17 = encodingfixation; 18 = encodingimage; 19 = encodingimage; 20 = encodingimage;
21 = encodingfixation; 22 = encodingimage; 23 = encodingimage; 24 = encodingimage;
25 = encodingfixation; 26 = encodingimage; 27 = encodingimage; 28 = encodingimage;
29 = encodingfixation; 30 = encodingimage; 31 = encodingimage; 32 = encodingimage;
]
</block>
<block retrievalphase>
/ ontrialbegin = [
values.responseCategory = "";
]
/ trials = [1-2=itemtimetarget,itemtimelure]
/ ontrialend = [
if (block.retrievaltrialtarget.responsetext == parameters.noKey){
values.responseCategory = "no";
} else if (block.retrievaltrialtarget.responsetext == parameters.yesKey){
values.responseCategory = "yes";
}
]
</block>
**************************************************************************************************************
**************************************************************************************************************
EXPERIMENT
**************************************************************************************************************
**************************************************************************************************************
<expt>
/ blocks = [1 = pairings; 2 = encodingphase; 3 = retrievalphase]
</expt>