Millisecond Forums

Storing stimuli and its locations to show the same stimuli once again in the same locations and same order

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

By aarthiravi - 2/17/2022

Hi,
I have just started using Inquisit for two weeks now.
I am trying to create an experiment where 3 images are shown one after the other in 3 different locations on the screen. 
I am randomly pairing 3 images together without replacement after which they will be presented in the sequence below. I would like to present the same sequence, the same pairings, same image locations once again to the same participant. 

The next participant will get a different pairing and so on.

So one block would be
Study trial :
1st presentation: Fixation cross -> image1 -> image2-> image3 -> Fixation cross -> image4 -> image5-> image6 -> Fixation cross -> image7 -> image8-> image9 -> Fixation cross -> image10 -> image11-> image12
Repeat presentation: Fixation cross -> image1 -> image2-> image3 -> Fixation cross -> image4 -> image5-> image6 -> Fixation cross -> image7 -> image8-> image9 -> Fixation cross -> image10 -> image11-> image12

Test Trial: ...

More blocks of the same type would follow with a study trial (fixation plus 12 images presented twice) and then a test trial immediately after.
 
So far, I have been successful in randomly pairing the images in groups of 3, presenting the images, storing their locations, and the name of the image presented.

Please help me code how to present the same sequence once more.
Thanks!

This is my code so far...
**************************************************************************************************************
**************************************************************************************************************
    PARAMETERS
**************************************************************************************************************
**************************************************************************************************************
<parameters>
/ stimsize = 17%
/ stimulusduration = 1000
</parameters>

**************************************************************************************************************
**************************************************************************************************************
    STIMULI
**************************************************************************************************************
**************************************************************************************************************

<item oldstims>
/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"
</item>

<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.oldstims
/ select = values.tripletimage
/ size = (parameters.stimsize, parameters.stimsize)
</picture>

**************************************************************************************************************
**************************************************************************************************************
    VALUES: automatically updated
**************************************************************************************************************
**************************************************************************************************************
<values>
/ index = 1
/ tripletimage = 1
</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 xpos>
/ items = (25%, 75%, 50%)
/ replace = false
/ selectionrate = always
</list>

<list ypos>
/ items = (25%, 25%, 75%)
/ selectionmode = list.xpos.currentindex
/ 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>
/ select = values.index
/ selectionrate = always
</list>

**************************************************************************************************************
**************************************************************************************************************
    DATA
**************************************************************************************************************
**************************************************************************************************************
***********************
raw data file
***********************
<data>
/ columns = (build, computer.platform, date, time, subject, group, session,
blockcode, blocknum, trialcode, trialnum, stimulusnumber, stimulusitem, picture.tripletimage.hposition, picture.tripletimage.vposition,
parameters.stimulusduration, expressions.canvasRatio)
</data>

<expressions>
/canvasRatio = (display.canvasheight/display.height)*100
/locationx =
</expressions>

**************************************************************************************************************
**************************************************************************************************************
    TRIALS     
**************************************************************************************************************
**************************************************************************************************************
<trial pairings>
/ ontrialbegin = [

    if (parameters.randomPairings == 1){
        values.index = list.tripletnumbers.nextvalue;
        list.imagenumbers.insertitem(values.index, 1);    
    
    } else {
        values.index += 1;
        list.imagenumbers.insertitem(values.index, 1);    
    };

]
/ branch = [
    if (list.imagenumbers.itemcount < 3){
        return trial.pairings;
    };
]
/ recorddata = false
/ trialduration = 0
</trial>

<trial encodingfixation>
/ stimulustimes = [0=fixation]
/ timeout = parameters.stimulusduration
</trial>

<trial encodingimage>
/ ontrialbegin = [
    values.tripletimage = list.imagenumbers.nextindex;
    
    picture.tripletimage.hposition = list.xpos.nextvalue;
    picture.tripletimage.vposition = list.ypos.nextvalue;]
    / stimulustimes = [0=picture.tripletimage]
    / timeout = parameters.stimulusduration
</trial>

**************************************************************************************************************
**************************************************************************************************************
    BLOCKS
**************************************************************************************************************
**************************************************************************************************************
<block pairings>
/ onblockbegin = [
    list.imagenumbers.reset();
    values.index = 0;
]
/ 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;
]
</block>


**************************************************************************************************************
**************************************************************************************************************
    EXPERIMENT
**************************************************************************************************************
**************************************************************************************************************

<expt>
/ blocks = [1= pairings; 2 = encodingphase]
</expt>
By Dave - 2/18/2022

aarthiravi - 2/18/2022
Hi,
I have just started using Inquisit for two weeks now.
I am trying to create an experiment where 3 images are shown one after the other in 3 different locations on the screen. 
I am randomly pairing 3 images together without replacement after which they will be presented in the sequence below. I would like to present the same sequence, the same pairings, same image locations once again to the same participant. 

The next participant will get a different pairing and so on.

So one block would be
Study trial :
1st presentation: Fixation cross -> image1 -> image2-> image3 -> Fixation cross -> image4 -> image5-> image6 -> Fixation cross -> image7 -> image8-> image9 -> Fixation cross -> image10 -> image11-> image12
Repeat presentation: Fixation cross -> image1 -> image2-> image3 -> Fixation cross -> image4 -> image5-> image6 -> Fixation cross -> image7 -> image8-> image9 -> Fixation cross -> image10 -> image11-> image12

Test Trial: ...

More blocks of the same type would follow with a study trial (fixation plus 12 images presented twice) and then a test trial immediately after.
 
So far, I have been successful in randomly pairing the images in groups of 3, presenting the images, storing their locations, and the name of the image presented.

Please help me code how to present the same sequence once more.
Thanks!

This is my code so far...
**************************************************************************************************************
**************************************************************************************************************
    PARAMETERS
**************************************************************************************************************
**************************************************************************************************************
<parameters>
/ stimsize = 17%
/ stimulusduration = 1000
</parameters>

**************************************************************************************************************
**************************************************************************************************************
    STIMULI
**************************************************************************************************************
**************************************************************************************************************

<item oldstims>
/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"
</item>

<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.oldstims
/ select = values.tripletimage
/ size = (parameters.stimsize, parameters.stimsize)
</picture>

**************************************************************************************************************
**************************************************************************************************************
    VALUES: automatically updated
**************************************************************************************************************
**************************************************************************************************************
<values>
/ index = 1
/ tripletimage = 1
</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 xpos>
/ items = (25%, 75%, 50%)
/ replace = false
/ selectionrate = always
</list>

<list ypos>
/ items = (25%, 25%, 75%)
/ selectionmode = list.xpos.currentindex
/ 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>
/ select = values.index
/ selectionrate = always
</list>

**************************************************************************************************************
**************************************************************************************************************
    DATA
**************************************************************************************************************
**************************************************************************************************************
***********************
raw data file
***********************
<data>
/ columns = (build, computer.platform, date, time, subject, group, session,
blockcode, blocknum, trialcode, trialnum, stimulusnumber, stimulusitem, picture.tripletimage.hposition, picture.tripletimage.vposition,
parameters.stimulusduration, expressions.canvasRatio)
</data>

<expressions>
/canvasRatio = (display.canvasheight/display.height)*100
/locationx =
</expressions>

**************************************************************************************************************
**************************************************************************************************************
    TRIALS     
**************************************************************************************************************
**************************************************************************************************************
<trial pairings>
/ ontrialbegin = [

    if (parameters.randomPairings == 1){
        values.index = list.tripletnumbers.nextvalue;
        list.imagenumbers.insertitem(values.index, 1);    
    
    } else {
        values.index += 1;
        list.imagenumbers.insertitem(values.index, 1);    
    };

]
/ branch = [
    if (list.imagenumbers.itemcount < 3){
        return trial.pairings;
    };
]
/ recorddata = false
/ trialduration = 0
</trial>

<trial encodingfixation>
/ stimulustimes = [0=fixation]
/ timeout = parameters.stimulusduration
</trial>

<trial encodingimage>
/ ontrialbegin = [
    values.tripletimage = list.imagenumbers.nextindex;
    
    picture.tripletimage.hposition = list.xpos.nextvalue;
    picture.tripletimage.vposition = list.ypos.nextvalue;]
    / stimulustimes = [0=picture.tripletimage]
    / timeout = parameters.stimulusduration
</trial>

**************************************************************************************************************
**************************************************************************************************************
    BLOCKS
**************************************************************************************************************
**************************************************************************************************************
<block pairings>
/ onblockbegin = [
    list.imagenumbers.reset();
    values.index = 0;
]
/ 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;
]
</block>


**************************************************************************************************************
**************************************************************************************************************
    EXPERIMENT
**************************************************************************************************************
**************************************************************************************************************

<expt>
/ blocks = [1= pairings; 2 = encodingphase]
</expt>

I don't understand what your pairings block / trial is supposed to do. As far as I can see, it does absolutely nothing? Please explain.
By Dave - 2/18/2022

Dave - 2/18/2022
aarthiravi - 2/18/2022
Hi,
I have just started using Inquisit for two weeks now.
I am trying to create an experiment where 3 images are shown one after the other in 3 different locations on the screen. 
I am randomly pairing 3 images together without replacement after which they will be presented in the sequence below. I would like to present the same sequence, the same pairings, same image locations once again to the same participant. 

The next participant will get a different pairing and so on.

So one block would be
Study trial :
1st presentation: Fixation cross -> image1 -> image2-> image3 -> Fixation cross -> image4 -> image5-> image6 -> Fixation cross -> image7 -> image8-> image9 -> Fixation cross -> image10 -> image11-> image12
Repeat presentation: Fixation cross -> image1 -> image2-> image3 -> Fixation cross -> image4 -> image5-> image6 -> Fixation cross -> image7 -> image8-> image9 -> Fixation cross -> image10 -> image11-> image12

Test Trial: ...

More blocks of the same type would follow with a study trial (fixation plus 12 images presented twice) and then a test trial immediately after.
 
So far, I have been successful in randomly pairing the images in groups of 3, presenting the images, storing their locations, and the name of the image presented.

Please help me code how to present the same sequence once more.
Thanks!

This is my code so far...
**************************************************************************************************************
**************************************************************************************************************
    PARAMETERS
**************************************************************************************************************
**************************************************************************************************************
<parameters>
/ stimsize = 17%
/ stimulusduration = 1000
</parameters>

**************************************************************************************************************
**************************************************************************************************************
    STIMULI
**************************************************************************************************************
**************************************************************************************************************

<item oldstims>
/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"
</item>

<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.oldstims
/ select = values.tripletimage
/ size = (parameters.stimsize, parameters.stimsize)
</picture>

**************************************************************************************************************
**************************************************************************************************************
    VALUES: automatically updated
**************************************************************************************************************
**************************************************************************************************************
<values>
/ index = 1
/ tripletimage = 1
</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 xpos>
/ items = (25%, 75%, 50%)
/ replace = false
/ selectionrate = always
</list>

<list ypos>
/ items = (25%, 25%, 75%)
/ selectionmode = list.xpos.currentindex
/ 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>
/ select = values.index
/ selectionrate = always
</list>

**************************************************************************************************************
**************************************************************************************************************
    DATA
**************************************************************************************************************
**************************************************************************************************************
***********************
raw data file
***********************
<data>
/ columns = (build, computer.platform, date, time, subject, group, session,
blockcode, blocknum, trialcode, trialnum, stimulusnumber, stimulusitem, picture.tripletimage.hposition, picture.tripletimage.vposition,
parameters.stimulusduration, expressions.canvasRatio)
</data>

<expressions>
/canvasRatio = (display.canvasheight/display.height)*100
/locationx =
</expressions>

**************************************************************************************************************
**************************************************************************************************************
    TRIALS     
**************************************************************************************************************
**************************************************************************************************************
<trial pairings>
/ ontrialbegin = [

    if (parameters.randomPairings == 1){
        values.index = list.tripletnumbers.nextvalue;
        list.imagenumbers.insertitem(values.index, 1);    
    
    } else {
        values.index += 1;
        list.imagenumbers.insertitem(values.index, 1);    
    };

]
/ branch = [
    if (list.imagenumbers.itemcount < 3){
        return trial.pairings;
    };
]
/ recorddata = false
/ trialduration = 0
</trial>

<trial encodingfixation>
/ stimulustimes = [0=fixation]
/ timeout = parameters.stimulusduration
</trial>

<trial encodingimage>
/ ontrialbegin = [
    values.tripletimage = list.imagenumbers.nextindex;
    
    picture.tripletimage.hposition = list.xpos.nextvalue;
    picture.tripletimage.vposition = list.ypos.nextvalue;]
    / stimulustimes = [0=picture.tripletimage]
    / timeout = parameters.stimulusduration
</trial>

**************************************************************************************************************
**************************************************************************************************************
    BLOCKS
**************************************************************************************************************
**************************************************************************************************************
<block pairings>
/ onblockbegin = [
    list.imagenumbers.reset();
    values.index = 0;
]
/ 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;
]
</block>


**************************************************************************************************************
**************************************************************************************************************
    EXPERIMENT
**************************************************************************************************************
**************************************************************************************************************

<expt>
/ blocks = [1= pairings; 2 = encodingphase]
</expt>

I don't understand what your pairings block / trial is supposed to do. As far as I can see, it does absolutely nothing? Please explain.

Anyway, going by your description, you should do something like this:


**************************************************************************************************************
**************************************************************************************************************
PARAMETERS
**************************************************************************************************************
**************************************************************************************************************
<parameters>
/ stimsize = 17%
/ stimulusduration = 1000
</parameters>

**************************************************************************************************************
**************************************************************************************************************
STIMULI
**************************************************************************************************************
**************************************************************************************************************

<item oldstims>
/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"
</item>

<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.oldstims
/ select = values.tripletimage
/ size = (parameters.stimsize, parameters.stimsize)
</picture>

**************************************************************************************************************
**************************************************************************************************************
VALUES: automatically updated
**************************************************************************************************************
**************************************************************************************************************
<values>
/ tripletimage = 1
</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 xpos>
/ items = (25%, 75%, 50%)
/ replace = false
/ selectionrate = always
</list>

<list ypos>
/ items = (25%, 25%, 75%)
/ selectionmode = list.xpos.currentindex
/ 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>


**************************************************************************************************************
**************************************************************************************************************
DATA
**************************************************************************************************************
**************************************************************************************************************
***********************
raw data file
***********************
<data>
/ columns = (build, computer.platform, date, time, subject, group, session,
blockcode, blocknum, trialcode, trialnum, stimulusnumber, stimulusitem, picture.tripletimage.hposition, picture.tripletimage.vposition,
parameters.stimulusduration, expressions.canvasRatio)
</data>

<expressions>
/canvasRatio = (display.canvasheight/display.height)*100
/locationx =
</expressions>

**************************************************************************************************************
**************************************************************************************************************
TRIALS
**************************************************************************************************************
**************************************************************************************************************
<trial pairings>
/ ontrialbegin = [
    list.imagenumbers.reset();
    list.tripletnumbers.reset();
    list.tripletxpos.reset();
    list.tripletypos.reset();
    var i = 0;
    while (i < list.imagenumbers.itemcount){
        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>

**************************************************************************************************************
**************************************************************************************************************
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>


**************************************************************************************************************
**************************************************************************************************************
EXPERIMENT
**************************************************************************************************************
**************************************************************************************************************

<expt>
/ blocks = [1 = pairings; 2 = encodingphase; ]
</expt>
By aarthiravi - 2/18/2022

Dave - 2/18/2022
Dave - 2/18/2022
aarthiravi - 2/18/2022
Hi,
I have just started using Inquisit for two weeks now.
I am trying to create an experiment where 3 images are shown one after the other in 3 different locations on the screen. 
I am randomly pairing 3 images together without replacement after which they will be presented in the sequence below. I would like to present the same sequence, the same pairings, same image locations once again to the same participant. 

The next participant will get a different pairing and so on.

So one block would be
Study trial :
1st presentation: Fixation cross -> image1 -> image2-> image3 -> Fixation cross -> image4 -> image5-> image6 -> Fixation cross -> image7 -> image8-> image9 -> Fixation cross -> image10 -> image11-> image12
Repeat presentation: Fixation cross -> image1 -> image2-> image3 -> Fixation cross -> image4 -> image5-> image6 -> Fixation cross -> image7 -> image8-> image9 -> Fixation cross -> image10 -> image11-> image12

Test Trial: ...

More blocks of the same type would follow with a study trial (fixation plus 12 images presented twice) and then a test trial immediately after.
 
So far, I have been successful in randomly pairing the images in groups of 3, presenting the images, storing their locations, and the name of the image presented.

Please help me code how to present the same sequence once more.
Thanks!

This is my code so far...
**************************************************************************************************************
**************************************************************************************************************
    PARAMETERS
**************************************************************************************************************
**************************************************************************************************************
<parameters>
/ stimsize = 17%
/ stimulusduration = 1000
</parameters>

**************************************************************************************************************
**************************************************************************************************************
    STIMULI
**************************************************************************************************************
**************************************************************************************************************

<item oldstims>
/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"
</item>

<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.oldstims
/ select = values.tripletimage
/ size = (parameters.stimsize, parameters.stimsize)
</picture>

**************************************************************************************************************
**************************************************************************************************************
    VALUES: automatically updated
**************************************************************************************************************
**************************************************************************************************************
<values>
/ index = 1
/ tripletimage = 1
</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 xpos>
/ items = (25%, 75%, 50%)
/ replace = false
/ selectionrate = always
</list>

<list ypos>
/ items = (25%, 25%, 75%)
/ selectionmode = list.xpos.currentindex
/ 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>
/ select = values.index
/ selectionrate = always
</list>

**************************************************************************************************************
**************************************************************************************************************
    DATA
**************************************************************************************************************
**************************************************************************************************************
***********************
raw data file
***********************
<data>
/ columns = (build, computer.platform, date, time, subject, group, session,
blockcode, blocknum, trialcode, trialnum, stimulusnumber, stimulusitem, picture.tripletimage.hposition, picture.tripletimage.vposition,
parameters.stimulusduration, expressions.canvasRatio)
</data>

<expressions>
/canvasRatio = (display.canvasheight/display.height)*100
/locationx =
</expressions>

**************************************************************************************************************
**************************************************************************************************************
    TRIALS     
**************************************************************************************************************
**************************************************************************************************************
<trial pairings>
/ ontrialbegin = [

    if (parameters.randomPairings == 1){
        values.index = list.tripletnumbers.nextvalue;
        list.imagenumbers.insertitem(values.index, 1);    
    
    } else {
        values.index += 1;
        list.imagenumbers.insertitem(values.index, 1);    
    };

]
/ branch = [
    if (list.imagenumbers.itemcount < 3){
        return trial.pairings;
    };
]
/ recorddata = false
/ trialduration = 0
</trial>

<trial encodingfixation>
/ stimulustimes = [0=fixation]
/ timeout = parameters.stimulusduration
</trial>

<trial encodingimage>
/ ontrialbegin = [
    values.tripletimage = list.imagenumbers.nextindex;
    
    picture.tripletimage.hposition = list.xpos.nextvalue;
    picture.tripletimage.vposition = list.ypos.nextvalue;]
    / stimulustimes = [0=picture.tripletimage]
    / timeout = parameters.stimulusduration
</trial>

**************************************************************************************************************
**************************************************************************************************************
    BLOCKS
**************************************************************************************************************
**************************************************************************************************************
<block pairings>
/ onblockbegin = [
    list.imagenumbers.reset();
    values.index = 0;
]
/ 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;
]
</block>


**************************************************************************************************************
**************************************************************************************************************
    EXPERIMENT
**************************************************************************************************************
**************************************************************************************************************

<expt>
/ blocks = [1= pairings; 2 = encodingphase]
</expt>

I don't understand what your pairings block / trial is supposed to do. As far as I can see, it does absolutely nothing? Please explain.

Anyway, going by your description, you should do something like this:


**************************************************************************************************************
**************************************************************************************************************
PARAMETERS
**************************************************************************************************************
**************************************************************************************************************
<parameters>
/ stimsize = 17%
/ stimulusduration = 1000
</parameters>

**************************************************************************************************************
**************************************************************************************************************
STIMULI
**************************************************************************************************************
**************************************************************************************************************

<item oldstims>
/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"
</item>

<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.oldstims
/ select = values.tripletimage
/ size = (parameters.stimsize, parameters.stimsize)
</picture>

**************************************************************************************************************
**************************************************************************************************************
VALUES: automatically updated
**************************************************************************************************************
**************************************************************************************************************
<values>
/ tripletimage = 1
</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 xpos>
/ items = (25%, 75%, 50%)
/ replace = false
/ selectionrate = always
</list>

<list ypos>
/ items = (25%, 25%, 75%)
/ selectionmode = list.xpos.currentindex
/ 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>


**************************************************************************************************************
**************************************************************************************************************
DATA
**************************************************************************************************************
**************************************************************************************************************
***********************
raw data file
***********************
<data>
/ columns = (build, computer.platform, date, time, subject, group, session,
blockcode, blocknum, trialcode, trialnum, stimulusnumber, stimulusitem, picture.tripletimage.hposition, picture.tripletimage.vposition,
parameters.stimulusduration, expressions.canvasRatio)
</data>

<expressions>
/canvasRatio = (display.canvasheight/display.height)*100
/locationx =
</expressions>

**************************************************************************************************************
**************************************************************************************************************
TRIALS
**************************************************************************************************************
**************************************************************************************************************
<trial pairings>
/ ontrialbegin = [
    list.imagenumbers.reset();
    list.tripletnumbers.reset();
    list.tripletxpos.reset();
    list.tripletypos.reset();
    var i = 0;
    while (i < list.imagenumbers.itemcount){
        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>

**************************************************************************************************************
**************************************************************************************************************
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>


**************************************************************************************************************
**************************************************************************************************************
EXPERIMENT
**************************************************************************************************************
**************************************************************************************************************

<expt>
/ blocks = [1 = pairings; 2 = encodingphase; ]
</expt>

Hi Dave,
Thank you so much! This is exactly what I was looking for. The initial trial "pairings" code randomly paired the stimuli into groups of three and presented them. But I think that approach was wrong compared to yours. Anyways, thank you!
By Dave - 2/18/2022

aarthiravi - 2/18/2022
Dave - 2/18/2022
Dave - 2/18/2022
aarthiravi - 2/18/2022
Hi,
I have just started using Inquisit for two weeks now.
I am trying to create an experiment where 3 images are shown one after the other in 3 different locations on the screen. 
I am randomly pairing 3 images together without replacement after which they will be presented in the sequence below. I would like to present the same sequence, the same pairings, same image locations once again to the same participant. 

The next participant will get a different pairing and so on.

So one block would be
Study trial :
1st presentation: Fixation cross -> image1 -> image2-> image3 -> Fixation cross -> image4 -> image5-> image6 -> Fixation cross -> image7 -> image8-> image9 -> Fixation cross -> image10 -> image11-> image12
Repeat presentation: Fixation cross -> image1 -> image2-> image3 -> Fixation cross -> image4 -> image5-> image6 -> Fixation cross -> image7 -> image8-> image9 -> Fixation cross -> image10 -> image11-> image12

Test Trial: ...

More blocks of the same type would follow with a study trial (fixation plus 12 images presented twice) and then a test trial immediately after.
 
So far, I have been successful in randomly pairing the images in groups of 3, presenting the images, storing their locations, and the name of the image presented.

Please help me code how to present the same sequence once more.
Thanks!

This is my code so far...
**************************************************************************************************************
**************************************************************************************************************
    PARAMETERS
**************************************************************************************************************
**************************************************************************************************************
<parameters>
/ stimsize = 17%
/ stimulusduration = 1000
</parameters>

**************************************************************************************************************
**************************************************************************************************************
    STIMULI
**************************************************************************************************************
**************************************************************************************************************

<item oldstims>
/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"
</item>

<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.oldstims
/ select = values.tripletimage
/ size = (parameters.stimsize, parameters.stimsize)
</picture>

**************************************************************************************************************
**************************************************************************************************************
    VALUES: automatically updated
**************************************************************************************************************
**************************************************************************************************************
<values>
/ index = 1
/ tripletimage = 1
</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 xpos>
/ items = (25%, 75%, 50%)
/ replace = false
/ selectionrate = always
</list>

<list ypos>
/ items = (25%, 25%, 75%)
/ selectionmode = list.xpos.currentindex
/ 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>
/ select = values.index
/ selectionrate = always
</list>

**************************************************************************************************************
**************************************************************************************************************
    DATA
**************************************************************************************************************
**************************************************************************************************************
***********************
raw data file
***********************
<data>
/ columns = (build, computer.platform, date, time, subject, group, session,
blockcode, blocknum, trialcode, trialnum, stimulusnumber, stimulusitem, picture.tripletimage.hposition, picture.tripletimage.vposition,
parameters.stimulusduration, expressions.canvasRatio)
</data>

<expressions>
/canvasRatio = (display.canvasheight/display.height)*100
/locationx =
</expressions>

**************************************************************************************************************
**************************************************************************************************************
    TRIALS     
**************************************************************************************************************
**************************************************************************************************************
<trial pairings>
/ ontrialbegin = [

    if (parameters.randomPairings == 1){
        values.index = list.tripletnumbers.nextvalue;
        list.imagenumbers.insertitem(values.index, 1);    
    
    } else {
        values.index += 1;
        list.imagenumbers.insertitem(values.index, 1);    
    };

]
/ branch = [
    if (list.imagenumbers.itemcount < 3){
        return trial.pairings;
    };
]
/ recorddata = false
/ trialduration = 0
</trial>

<trial encodingfixation>
/ stimulustimes = [0=fixation]
/ timeout = parameters.stimulusduration
</trial>

<trial encodingimage>
/ ontrialbegin = [
    values.tripletimage = list.imagenumbers.nextindex;
    
    picture.tripletimage.hposition = list.xpos.nextvalue;
    picture.tripletimage.vposition = list.ypos.nextvalue;]
    / stimulustimes = [0=picture.tripletimage]
    / timeout = parameters.stimulusduration
</trial>

**************************************************************************************************************
**************************************************************************************************************
    BLOCKS
**************************************************************************************************************
**************************************************************************************************************
<block pairings>
/ onblockbegin = [
    list.imagenumbers.reset();
    values.index = 0;
]
/ 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;
]
</block>


**************************************************************************************************************
**************************************************************************************************************
    EXPERIMENT
**************************************************************************************************************
**************************************************************************************************************

<expt>
/ blocks = [1= pairings; 2 = encodingphase]
</expt>

I don't understand what your pairings block / trial is supposed to do. As far as I can see, it does absolutely nothing? Please explain.

Anyway, going by your description, you should do something like this:


**************************************************************************************************************
**************************************************************************************************************
PARAMETERS
**************************************************************************************************************
**************************************************************************************************************
<parameters>
/ stimsize = 17%
/ stimulusduration = 1000
</parameters>

**************************************************************************************************************
**************************************************************************************************************
STIMULI
**************************************************************************************************************
**************************************************************************************************************

<item oldstims>
/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"
</item>

<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.oldstims
/ select = values.tripletimage
/ size = (parameters.stimsize, parameters.stimsize)
</picture>

**************************************************************************************************************
**************************************************************************************************************
VALUES: automatically updated
**************************************************************************************************************
**************************************************************************************************************
<values>
/ tripletimage = 1
</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 xpos>
/ items = (25%, 75%, 50%)
/ replace = false
/ selectionrate = always
</list>

<list ypos>
/ items = (25%, 25%, 75%)
/ selectionmode = list.xpos.currentindex
/ 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>


**************************************************************************************************************
**************************************************************************************************************
DATA
**************************************************************************************************************
**************************************************************************************************************
***********************
raw data file
***********************
<data>
/ columns = (build, computer.platform, date, time, subject, group, session,
blockcode, blocknum, trialcode, trialnum, stimulusnumber, stimulusitem, picture.tripletimage.hposition, picture.tripletimage.vposition,
parameters.stimulusduration, expressions.canvasRatio)
</data>

<expressions>
/canvasRatio = (display.canvasheight/display.height)*100
/locationx =
</expressions>

**************************************************************************************************************
**************************************************************************************************************
TRIALS
**************************************************************************************************************
**************************************************************************************************************
<trial pairings>
/ ontrialbegin = [
    list.imagenumbers.reset();
    list.tripletnumbers.reset();
    list.tripletxpos.reset();
    list.tripletypos.reset();
    var i = 0;
    while (i < list.imagenumbers.itemcount){
        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>

**************************************************************************************************************
**************************************************************************************************************
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>


**************************************************************************************************************
**************************************************************************************************************
EXPERIMENT
**************************************************************************************************************
**************************************************************************************************************

<expt>
/ blocks = [1 = pairings; 2 = encodingphase; ]
</expt>

Hi Dave,
Thank you so much! This is exactly what I was looking for. The initial trial "pairings" code randomly paired the stimuli into groups of three and presented them. But I think that approach was wrong compared to yours. Anyways, thank you!

> The initial trial "pairings" code randomly paired the stimuli into groups of three and presented them.

For the record: It did not. That code was entirely unfunctional, it did not do a single thing.
By aarthiravi - 2/20/2022

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>
By Dave - 2/21/2022

aarthiravi - 2/20/2022
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>

// 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>

To randomly select a triplet, sample a value from the above list. That gives you the start index of either the 1st, 2nd, 3rd or 4th triplet. The other items in the selected triplet, by way of simple math, are at the selected start index +1 and +2.
By aarthiravi - 2/21/2022

Okay, so I did something like this. But the value of "values.whichtriplet" is still not changing for every trial. The same triplet is being shown for all trials whereas it should change.

<values>
/ whichtriplet = 1
</values>

**Target trial**

<trial itemtimetarget>
/ ontrialbegin = [
  list.tripletstart.reset()
    values.whichtriplet=list.tripletstart.nextvalue;
  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
 
  values.orderpic1 = getitem(list.tripletnumbers, values.whichtriplet);
    values.orderpic2 = getitem(list.tripletnumbers, values.whichtriplet+1);
    values.orderpic3 = getitem(list.tripletnumbers, values.whichtriplet+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));
]
</trial>
By Dave - 2/21/2022

aarthiravi - 2/21/2022
Okay, so I did something like this. But the value of "values.whichtriplet" is still not changing for every trial. The same triplet is being shown for all trials whereas it should change.

<values>
/ whichtriplet = 1
</values>

**Target trial**

<trial itemtimetarget>
/ ontrialbegin = [
  list.tripletstart.reset()
    values.whichtriplet=list.tripletstart.nextvalue;
  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
 
  values.orderpic1 = getitem(list.tripletnumbers, values.whichtriplet);
    values.orderpic2 = getitem(list.tripletnumbers, values.whichtriplet+1);
    values.orderpic3 = getitem(list.tripletnumbers, values.whichtriplet+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));
]
</trial>

I cannot tell you where your mistake is based on an isolated code snippet, which does not includ most of the relevant aspects.
By aarthiravi - 2/21/2022

Dave - 2/21/2022
aarthiravi - 2/21/2022
Okay, so I did something like this. But the value of "values.whichtriplet" is still not changing for every trial. The same triplet is being shown for all trials whereas it should change.

<values>
/ whichtriplet = 1
</values>

**Target trial**

<trial itemtimetarget>
/ ontrialbegin = [
  list.tripletstart.reset()
    values.whichtriplet=list.tripletstart.nextvalue;
  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
 
  values.orderpic1 = getitem(list.tripletnumbers, values.whichtriplet);
    values.orderpic2 = getitem(list.tripletnumbers, values.whichtriplet+1);
    values.orderpic3 = getitem(list.tripletnumbers, values.whichtriplet+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));
]
</trial>

I cannot tell you where your mistake is based on an isolated code snippet, which does not includ most of the relevant aspects.

Oh sorry! It's pretty much the same code as in the previous post. I'll post the full code here once again for this particular condition. The new additions are in red color.
**************************************************************************************************************
**************************************************************************************************************
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>

// 13 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 = 1
/ whichluretype = 1
/ 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 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 = [
list.tripletstart.reset()
  // randomly select one of the presented triplets
  values.whichtriplet=list.tripletstart.nextvalue;


  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 items within that triplet, assign to orderpics

  values.orderpic1 = getitem(list.tripletnumbers, values.whichtriplet);
  values.orderpic2 = getitem(list.tripletnumbers, values.whichtriplet+1);
  values.orderpic3 = getitem(list.tripletnumbers, values.whichtriplet+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));
]
</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]

/ 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>
By Dave - 2/21/2022

aarthiravi - 2/21/2022
Dave - 2/21/2022
aarthiravi - 2/21/2022
Okay, so I did something like this. But the value of "values.whichtriplet" is still not changing for every trial. The same triplet is being shown for all trials whereas it should change.

<values>
/ whichtriplet = 1
</values>

**Target trial**

<trial itemtimetarget>
/ ontrialbegin = [
  list.tripletstart.reset()
    values.whichtriplet=list.tripletstart.nextvalue;
  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
 
  values.orderpic1 = getitem(list.tripletnumbers, values.whichtriplet);
    values.orderpic2 = getitem(list.tripletnumbers, values.whichtriplet+1);
    values.orderpic3 = getitem(list.tripletnumbers, values.whichtriplet+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));
]
</trial>

I cannot tell you where your mistake is based on an isolated code snippet, which does not includ most of the relevant aspects.

Oh sorry! It's pretty much the same code as in the previous post. I'll post the full code here once again for this particular condition. The new additions are in red color.
**************************************************************************************************************
**************************************************************************************************************
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>

// 13 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 = 1
/ whichluretype = 1
/ 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 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 = [
list.tripletstart.reset()
  // randomly select one of the presented triplets
  values.whichtriplet=list.tripletstart.nextvalue;


  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 items within that triplet, assign to orderpics

  values.orderpic1 = getitem(list.tripletnumbers, values.whichtriplet);
  values.orderpic2 = getitem(list.tripletnumbers, values.whichtriplet+1);
  values.orderpic3 = getitem(list.tripletnumbers, values.whichtriplet+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));
]
</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]

/ 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>

Can you spot what's missing here?

By aarthiravi - 2/21/2022

Dave - 2/21/2022
aarthiravi - 2/21/2022
Dave - 2/21/2022
aarthiravi - 2/21/2022
Okay, so I did something like this. But the value of "values.whichtriplet" is still not changing for every trial. The same triplet is being shown for all trials whereas it should change.

<values>
/ whichtriplet = 1
</values>

**Target trial**

<trial itemtimetarget>
/ ontrialbegin = [
  list.tripletstart.reset()
    values.whichtriplet=list.tripletstart.nextvalue;
  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
 
  values.orderpic1 = getitem(list.tripletnumbers, values.whichtriplet);
    values.orderpic2 = getitem(list.tripletnumbers, values.whichtriplet+1);
    values.orderpic3 = getitem(list.tripletnumbers, values.whichtriplet+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));
]
</trial>

I cannot tell you where your mistake is based on an isolated code snippet, which does not includ most of the relevant aspects.

Oh sorry! It's pretty much the same code as in the previous post. I'll post the full code here once again for this particular condition. The new additions are in red color.
**************************************************************************************************************
**************************************************************************************************************
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>

// 13 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 = 1
/ whichluretype = 1
/ 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 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 = [
list.tripletstart.reset()
  // randomly select one of the presented triplets
  values.whichtriplet=list.tripletstart.nextvalue;


  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 items within that triplet, assign to orderpics

  values.orderpic1 = getitem(list.tripletnumbers, values.whichtriplet);
  values.orderpic2 = getitem(list.tripletnumbers, values.whichtriplet+1);
  values.orderpic3 = getitem(list.tripletnumbers, values.whichtriplet+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));
]
</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]

/ 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>

Can you spot what's missing here?


Oh! A semicolon! Oops. 
Thanks for pointing that out.
By aarthiravi - 2/21/2022

Dave - 2/21/2022
aarthiravi - 2/21/2022
Dave - 2/21/2022
aarthiravi - 2/21/2022
Okay, so I did something like this. But the value of "values.whichtriplet" is still not changing for every trial. The same triplet is being shown for all trials whereas it should change.

<values>
/ whichtriplet = 1
</values>

**Target trial**

<trial itemtimetarget>
/ ontrialbegin = [
  list.tripletstart.reset()
    values.whichtriplet=list.tripletstart.nextvalue;
  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
 
  values.orderpic1 = getitem(list.tripletnumbers, values.whichtriplet);
    values.orderpic2 = getitem(list.tripletnumbers, values.whichtriplet+1);
    values.orderpic3 = getitem(list.tripletnumbers, values.whichtriplet+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));
]
</trial>

I cannot tell you where your mistake is based on an isolated code snippet, which does not includ most of the relevant aspects.

Oh sorry! It's pretty much the same code as in the previous post. I'll post the full code here once again for this particular condition. The new additions are in red color.
**************************************************************************************************************
**************************************************************************************************************
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>

// 13 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 = 1
/ whichluretype = 1
/ 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 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 = [
list.tripletstart.reset()
  // randomly select one of the presented triplets
  values.whichtriplet=list.tripletstart.nextvalue;


  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 items within that triplet, assign to orderpics

  values.orderpic1 = getitem(list.tripletnumbers, values.whichtriplet);
  values.orderpic2 = getitem(list.tripletnumbers, values.whichtriplet+1);
  values.orderpic3 = getitem(list.tripletnumbers, values.whichtriplet+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));
]
</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]

/ 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>

Can you spot what's missing here?


So, when I run the experiment, the messages window wouldn't point that out? Is there a way to debug the code and prevent mistakes like this again? Or is it something that we should check manually?
By aarthiravi - 2/21/2022

aarthiravi - 2/21/2022
Dave - 2/21/2022
aarthiravi - 2/21/2022
Dave - 2/21/2022
aarthiravi - 2/21/2022
Okay, so I did something like this. But the value of "values.whichtriplet" is still not changing for every trial. The same triplet is being shown for all trials whereas it should change.

<values>
/ whichtriplet = 1
</values>

**Target trial**

<trial itemtimetarget>
/ ontrialbegin = [
  list.tripletstart.reset()
    values.whichtriplet=list.tripletstart.nextvalue;
  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
 
  values.orderpic1 = getitem(list.tripletnumbers, values.whichtriplet);
    values.orderpic2 = getitem(list.tripletnumbers, values.whichtriplet+1);
    values.orderpic3 = getitem(list.tripletnumbers, values.whichtriplet+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));
]
</trial>

I cannot tell you where your mistake is based on an isolated code snippet, which does not includ most of the relevant aspects.

Oh sorry! It's pretty much the same code as in the previous post. I'll post the full code here once again for this particular condition. The new additions are in red color.
**************************************************************************************************************
**************************************************************************************************************
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>

// 13 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 = 1
/ whichluretype = 1
/ 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 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 = [
list.tripletstart.reset()
  // randomly select one of the presented triplets
  values.whichtriplet=list.tripletstart.nextvalue;


  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 items within that triplet, assign to orderpics

  values.orderpic1 = getitem(list.tripletnumbers, values.whichtriplet);
  values.orderpic2 = getitem(list.tripletnumbers, values.whichtriplet+1);
  values.orderpic3 = getitem(list.tripletnumbers, values.whichtriplet+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));
]
</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]

/ 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>

Can you spot what's missing here?


So, when I run the experiment, the messages window wouldn't point that out? Is there a way to debug the code and prevent mistakes like this again? Or is it something that we should check manually?

I mean it's not a bug, it's a syntax error. How to check for syntax errors?
By Dave - 2/21/2022

aarthiravi - 2/21/2022
aarthiravi - 2/21/2022
Dave - 2/21/2022
aarthiravi - 2/21/2022
Dave - 2/21/2022
aarthiravi - 2/21/2022
Okay, so I did something like this. But the value of "values.whichtriplet" is still not changing for every trial. The same triplet is being shown for all trials whereas it should change.

<values>
/ whichtriplet = 1
</values>

**Target trial**

<trial itemtimetarget>
/ ontrialbegin = [
  list.tripletstart.reset()
    values.whichtriplet=list.tripletstart.nextvalue;
  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
 
  values.orderpic1 = getitem(list.tripletnumbers, values.whichtriplet);
    values.orderpic2 = getitem(list.tripletnumbers, values.whichtriplet+1);
    values.orderpic3 = getitem(list.tripletnumbers, values.whichtriplet+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));
]
</trial>

I cannot tell you where your mistake is based on an isolated code snippet, which does not includ most of the relevant aspects.

Oh sorry! It's pretty much the same code as in the previous post. I'll post the full code here once again for this particular condition. The new additions are in red color.
**************************************************************************************************************
**************************************************************************************************************
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>

// 13 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 = 1
/ whichluretype = 1
/ 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 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 = [
list.tripletstart.reset()
  // randomly select one of the presented triplets
  values.whichtriplet=list.tripletstart.nextvalue;


  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 items within that triplet, assign to orderpics

  values.orderpic1 = getitem(list.tripletnumbers, values.whichtriplet);
  values.orderpic2 = getitem(list.tripletnumbers, values.whichtriplet+1);
  values.orderpic3 = getitem(list.tripletnumbers, values.whichtriplet+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));
]
</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]

/ 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>

Can you spot what's missing here?


So, when I run the experiment, the messages window wouldn't point that out? Is there a way to debug the code and prevent mistakes like this again? Or is it something that we should check manually?

I mean it's not a bug, it's a syntax error. How to check for syntax errors?

The parser can catch a lot of syntax errors, but his one you just have to spot.
By aarthiravi - 2/21/2022

Dave - 2/21/2022
aarthiravi - 2/21/2022
aarthiravi - 2/21/2022
Dave - 2/21/2022
aarthiravi - 2/21/2022
Dave - 2/21/2022
aarthiravi - 2/21/2022
Okay, so I did something like this. But the value of "values.whichtriplet" is still not changing for every trial. The same triplet is being shown for all trials whereas it should change.

<values>
/ whichtriplet = 1
</values>

**Target trial**

<trial itemtimetarget>
/ ontrialbegin = [
  list.tripletstart.reset()
    values.whichtriplet=list.tripletstart.nextvalue;
  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
 
  values.orderpic1 = getitem(list.tripletnumbers, values.whichtriplet);
    values.orderpic2 = getitem(list.tripletnumbers, values.whichtriplet+1);
    values.orderpic3 = getitem(list.tripletnumbers, values.whichtriplet+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));
]
</trial>

I cannot tell you where your mistake is based on an isolated code snippet, which does not includ most of the relevant aspects.

Oh sorry! It's pretty much the same code as in the previous post. I'll post the full code here once again for this particular condition. The new additions are in red color.
**************************************************************************************************************
**************************************************************************************************************
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>

// 13 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 = 1
/ whichluretype = 1
/ 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 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 = [
list.tripletstart.reset()
  // randomly select one of the presented triplets
  values.whichtriplet=list.tripletstart.nextvalue;


  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 items within that triplet, assign to orderpics

  values.orderpic1 = getitem(list.tripletnumbers, values.whichtriplet);
  values.orderpic2 = getitem(list.tripletnumbers, values.whichtriplet+1);
  values.orderpic3 = getitem(list.tripletnumbers, values.whichtriplet+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));
]
</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]

/ 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>

Can you spot what's missing here?


So, when I run the experiment, the messages window wouldn't point that out? Is there a way to debug the code and prevent mistakes like this again? Or is it something that we should check manually?

I mean it's not a bug, it's a syntax error. How to check for syntax errors?

The parser can catch a lot of syntax errors, but his one you just have to spot.

Okay, got it! Thank you so much Dave!

By aarthiravi - 2/23/2022

Hi,

The updated code is below for the order condition which works great with your help. But I need to do one more thing.
There are 4 triplets and 4 retrieval trials with 2 targets and 2 lures. Though the triplets to be shown are being picked randomly, the same triplets appear for both target trials and lure trials. I would like to make sure that for every retrieval trial a new triplet is picked and the test question is asked.
The code is okay for the target trials where every time a new triplet is picked. But for the lure trials either the same triplet as the target trials is getting picked or both lure trials have the same triplet.

So, I guess the code for lure trials should be able to pick a triplet that wasn't picked in the target trial, nor should the same triplet be picked again for the next lure trial. I am aware of the noreplacenorepeat () option but I don't know how to incorporate it here. And I'd like to be able to do this for the other three conditions I have.

Any help on this would be appreciated. Thanks!

Revised code (includes 2 of the experimental conditions in my study):

**************************************************************************************************************
**************************************************************************************************************
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>

// items 13 to 20 are the new stims, not 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 pic1>
/ items = item.allstims
/ select = values.pic1
/ size = (parameters.stimsize, parameters.stimsize)
/ hposition = values.pic1x
/ vposition = values.pic1y
</picture>

<picture pic2>
/ items = item.allstims
/ select = values.pic2
/ size = (parameters.stimsize, parameters.stimsize)
/ hposition = values.pic2x
/ vposition = values.pic2y
</picture>

<picture pic3>
/ items = item.allstims
/ select = values.pic3
/ size = (parameters.stimsize, parameters.stimsize)
/ hposition = values.pic3x
/ vposition = values.pic3y
</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>

<text itemitemquestion>
/ items = ("Same group?")
/ position = (50%, 40%)
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/ size = (30%, 15%)
/ txcolor = black
</text>

**************************************************************************************************************
**************************************************************************************************************
VALUES: automatically updated
**************************************************************************************************************
**************************************************************************************************************
<values>
/ tripletimage = 1
/ pic1 = 1
/ pic2 = 1
/ pic3 = 1
/ orderpic1 = 1
/ orderpic2 = 1
/ orderpic3 = 1
/ pic1x = 0%
/ pic2x = 0%
/ pic3x = 0%
/ pic1y = 0%
/ pic2y = 0%
/ pic3y = 0%
/ whichtriplet = 1
/ whichluretype = 1
/ whichlocationx = 1
/ whichlocationy = 1
/ 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 item recognition and item-item test probe trials

<list rxpos>
/ items = (25%, 75%, 50%)
/ replace = false
/ selectionrate = always
</list>

<list rypos>
/ items = (50%, 50%, 50%)
/ replace = false
/ selectionrate = always
</list>

// list of locations for the item-time test/probe trials

<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 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-Item Condition /////////////////////////////////////////////////////////////////////////////////////////////////////////

**Target trial**
<trial itemitemtarget>
/ ontrialbegin = [
  list.tripletstart.reset();
    values.whichtriplet=list.tripletstart.nextvalue;
    
  values.pic1x = list.rxpos.nextvalue;
  values.pic2x = list.rxpos.nextvalue;
  values.pic3x = list.rxpos.nextvalue;
    values.pic1y = list.rypos.nextvalue;
  values.pic2y = list.rypos.nextvalue;
  values.pic3y = list.rypos.nextvalue;

    // randomly select one of the presented triplets, select items in order within that triplet
    // assign to pics in the locations they were presented during encoding phase
  values.pic1 = getitem(list.tripletnumbers, values.whichtriplet);
    values.pic2 = getitem(list.tripletnumbers, values.whichtriplet+1);
    values.pic3 = getitem(list.tripletnumbers, values.whichtriplet+2);
]
/ stimulustimes = [0 = pic1, pic2, pic3; 2000 = clearscreen, itemitemquestion, yes, no]
/ beginresponsetime = parameters.probeduration
/ response = timeout(parameters.responsewindow)
/ validresponse = (parameters.yesKey, parameters.nokey)
/ iscorrectresponse = [
  return (
  (trial.itemitemtarget.responsetext == parameters.yesKey) ||
  (trial.itemitemtarget.responsetext == parameters.noKey));
]
</trial>


**Lure trial**
<trial itemitemlure>
/ ontrialbegin = [
    list.tripletstart.reset();
  list.luretypes.reset();
    
    values.whichtriplet=list.tripletstart.nextvalue;
    values.whichluretype=list.luretypes.nextvalue;
    
  values.pic1x = list.rxpos.nextvalue;
  values.pic2x = list.rxpos.nextvalue;
  values.pic3x = list.rxpos.nextvalue;
    values.pic1y = list.rypos.nextvalue;
  values.pic2y = list.rypos.nextvalue;
  values.pic3y = list.rypos.nextvalue;

    // randomly select one of the presented triplets, select items in order within that triplet
    // assign to pics in the locations they were presented during encoding phase
    if (values.whichluretype=1){
        values.pic1 = getitem(list.tripletnumbers, values.whichtriplet);
        values.pic2 = getitem(list.tripletnumbers, values.whichtriplet+1);
        values.pic3 = list.tripletnumbers.item(list.tripletstart.nextvalue + list.itemwithintriplet.nextvalue);
        
   } elseif (values.whichluretype=2){
        values.pic1 = getitem(list.tripletnumbers, values.whichtriplet);
        values.pic2 = list.tripletnumbers.item(list.tripletstart.nextvalue + list.itemwithintriplet.nextvalue);
        values.pic3 = getitem(list.tripletnumbers, values.whichtriplet+2);
        
        } elseif (values.whichluretype=3){
        values.pic1 = list.tripletnumbers.item(list.tripletstart.nextvalue + list.itemwithintriplet.nextvalue);
        values.pic2 = getitem(list.tripletnumbers, values.whichtriplet+1);
        values.pic3 = getitem(list.tripletnumbers, values.whichtriplet+2);
        }
]
/ stimulustimes = [0 = pic1, pic2, pic3; 2000 = clearscreen, itemitemquestion, yes, no]
/ beginresponsetime = parameters.probeduration
/ response = timeout(parameters.responsewindow)
/ validresponse = (parameters.yesKey, parameters.nokey)
/ iscorrectresponse = [
  return (
  (trial.itemitemlure.responsetext == parameters.yesKey) ||
  (trial.itemitemlure.responsetext == parameters.noKey));
]
</trial>


// Item-Time Condition /////////////////////////////////////////////////////////////////////////////////////////////////////////

**Target trial**
<trial itemtimetarget>
/ ontrialbegin = [
  list.tripletstart.reset();
    values.whichtriplet=list.tripletstart.nextvalue;
    
  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 items in order within that triplet, assign to orderpics
  values.orderpic1 = getitem(list.tripletnumbers, values.whichtriplet);
    values.orderpic2 = getitem(list.tripletnumbers, values.whichtriplet+1);
    values.orderpic3 = getitem(list.tripletnumbers, values.whichtriplet+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));
]
</trial>


**Lure trial**
<trial itemtimelure>
/ ontrialbegin = [
  list.tripletstart.reset();
    list.luretypes.reset();
    
    values.whichtriplet=list.tripletstart.nextvalue;
    values.whichluretype=list.luretypes.nextvalue;
    
  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.whichluretype=1){
        values.orderpic1 = getitem(list.tripletnumbers, values.whichtriplet+1);
        values.orderpic2 = getitem(list.tripletnumbers, values.whichtriplet);
        values.orderpic3 = getitem(list.tripletnumbers, values.whichtriplet+2);
        
   } elseif (values.whichluretype=2){
        values.orderpic1 = getitem(list.tripletnumbers, values.whichtriplet+2);
        values.orderpic2 = getitem(list.tripletnumbers, values.whichtriplet+1);
        values.orderpic3 = getitem(list.tripletnumbers, values.whichtriplet);
        
        } elseif (values.whichluretype=3){
        values.orderpic1 = getitem(list.tripletnumbers, values.whichtriplet);
        values.orderpic2 = getitem(list.tripletnumbers, values.whichtriplet+2);
        values.orderpic3 = getitem(list.tripletnumbers, values.whichtriplet+1);
        }
]
/ 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>


**************************************************************************************************************
**************************************************************************************************************
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-4=noreplace(itemitemtarget, itemitemlure)]

/ ontrialend = [
if (block.retrievalphase.responsetext == parameters.noKey){
 values.responseCategory = "no";
} else if (block.retrievalphase.responsetext == parameters.yesKey){
 values.responseCategory = "yes";
}
]
</block>



**************************************************************************************************************
**************************************************************************************************************
EXPERIMENT
**************************************************************************************************************
**************************************************************************************************************

<expt>
/ blocks = [1 = pairings; 2 = encodingphase; 3 = retrievalphase]
</expt>
By Dave - 2/23/2022

aarthiravi - 2/23/2022
Hi,

The updated code is below for the order condition which works great with your help. But I need to do one more thing.
There are 4 triplets and 4 retrieval trials with 2 targets and 2 lures. Though the triplets to be shown are being picked randomly, the same triplets appear for both target trials and lure trials. I would like to make sure that for every retrieval trial a new triplet is picked and the test question is asked.
The code is okay for the target trials where every time a new triplet is picked. But for the lure trials either the same triplet as the target trials is getting picked or both lure trials have the same triplet.

So, I guess the code for lure trials should be able to pick a triplet that wasn't picked in the target trial, nor should the same triplet be picked again for the next lure trial. I am aware of the noreplacenorepeat () option but I don't know how to incorporate it here. And I'd like to be able to do this for the other three conditions I have.

Any help on this would be appreciated. Thanks!

Revised code (includes 2 of the experimental conditions in my study):

**************************************************************************************************************
**************************************************************************************************************
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>

// items 13 to 20 are the new stims, not 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 pic1>
/ items = item.allstims
/ select = values.pic1
/ size = (parameters.stimsize, parameters.stimsize)
/ hposition = values.pic1x
/ vposition = values.pic1y
</picture>

<picture pic2>
/ items = item.allstims
/ select = values.pic2
/ size = (parameters.stimsize, parameters.stimsize)
/ hposition = values.pic2x
/ vposition = values.pic2y
</picture>

<picture pic3>
/ items = item.allstims
/ select = values.pic3
/ size = (parameters.stimsize, parameters.stimsize)
/ hposition = values.pic3x
/ vposition = values.pic3y
</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>

<text itemitemquestion>
/ items = ("Same group?")
/ position = (50%, 40%)
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/ size = (30%, 15%)
/ txcolor = black
</text>

**************************************************************************************************************
**************************************************************************************************************
VALUES: automatically updated
**************************************************************************************************************
**************************************************************************************************************
<values>
/ tripletimage = 1
/ pic1 = 1
/ pic2 = 1
/ pic3 = 1
/ orderpic1 = 1
/ orderpic2 = 1
/ orderpic3 = 1
/ pic1x = 0%
/ pic2x = 0%
/ pic3x = 0%
/ pic1y = 0%
/ pic2y = 0%
/ pic3y = 0%
/ whichtriplet = 1
/ whichluretype = 1
/ whichlocationx = 1
/ whichlocationy = 1
/ 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 item recognition and item-item test probe trials

<list rxpos>
/ items = (25%, 75%, 50%)
/ replace = false
/ selectionrate = always
</list>

<list rypos>
/ items = (50%, 50%, 50%)
/ replace = false
/ selectionrate = always
</list>

// list of locations for the item-time test/probe trials

<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 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-Item Condition /////////////////////////////////////////////////////////////////////////////////////////////////////////

**Target trial**
<trial itemitemtarget>
/ ontrialbegin = [
  list.tripletstart.reset();
    values.whichtriplet=list.tripletstart.nextvalue;
    
  values.pic1x = list.rxpos.nextvalue;
  values.pic2x = list.rxpos.nextvalue;
  values.pic3x = list.rxpos.nextvalue;
    values.pic1y = list.rypos.nextvalue;
  values.pic2y = list.rypos.nextvalue;
  values.pic3y = list.rypos.nextvalue;

    // randomly select one of the presented triplets, select items in order within that triplet
    // assign to pics in the locations they were presented during encoding phase
  values.pic1 = getitem(list.tripletnumbers, values.whichtriplet);
    values.pic2 = getitem(list.tripletnumbers, values.whichtriplet+1);
    values.pic3 = getitem(list.tripletnumbers, values.whichtriplet+2);
]
/ stimulustimes = [0 = pic1, pic2, pic3; 2000 = clearscreen, itemitemquestion, yes, no]
/ beginresponsetime = parameters.probeduration
/ response = timeout(parameters.responsewindow)
/ validresponse = (parameters.yesKey, parameters.nokey)
/ iscorrectresponse = [
  return (
  (trial.itemitemtarget.responsetext == parameters.yesKey) ||
  (trial.itemitemtarget.responsetext == parameters.noKey));
]
</trial>


**Lure trial**
<trial itemitemlure>
/ ontrialbegin = [
    list.tripletstart.reset();
  list.luretypes.reset();
    
    values.whichtriplet=list.tripletstart.nextvalue;
    values.whichluretype=list.luretypes.nextvalue;
    
  values.pic1x = list.rxpos.nextvalue;
  values.pic2x = list.rxpos.nextvalue;
  values.pic3x = list.rxpos.nextvalue;
    values.pic1y = list.rypos.nextvalue;
  values.pic2y = list.rypos.nextvalue;
  values.pic3y = list.rypos.nextvalue;

    // randomly select one of the presented triplets, select items in order within that triplet
    // assign to pics in the locations they were presented during encoding phase
    if (values.whichluretype=1){
        values.pic1 = getitem(list.tripletnumbers, values.whichtriplet);
        values.pic2 = getitem(list.tripletnumbers, values.whichtriplet+1);
        values.pic3 = list.tripletnumbers.item(list.tripletstart.nextvalue + list.itemwithintriplet.nextvalue);
        
   } elseif (values.whichluretype=2){
        values.pic1 = getitem(list.tripletnumbers, values.whichtriplet);
        values.pic2 = list.tripletnumbers.item(list.tripletstart.nextvalue + list.itemwithintriplet.nextvalue);
        values.pic3 = getitem(list.tripletnumbers, values.whichtriplet+2);
        
        } elseif (values.whichluretype=3){
        values.pic1 = list.tripletnumbers.item(list.tripletstart.nextvalue + list.itemwithintriplet.nextvalue);
        values.pic2 = getitem(list.tripletnumbers, values.whichtriplet+1);
        values.pic3 = getitem(list.tripletnumbers, values.whichtriplet+2);
        }
]
/ stimulustimes = [0 = pic1, pic2, pic3; 2000 = clearscreen, itemitemquestion, yes, no]
/ beginresponsetime = parameters.probeduration
/ response = timeout(parameters.responsewindow)
/ validresponse = (parameters.yesKey, parameters.nokey)
/ iscorrectresponse = [
  return (
  (trial.itemitemlure.responsetext == parameters.yesKey) ||
  (trial.itemitemlure.responsetext == parameters.noKey));
]
</trial>


// Item-Time Condition /////////////////////////////////////////////////////////////////////////////////////////////////////////

**Target trial**
<trial itemtimetarget>
/ ontrialbegin = [
  list.tripletstart.reset();
    values.whichtriplet=list.tripletstart.nextvalue;
    
  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 items in order within that triplet, assign to orderpics
  values.orderpic1 = getitem(list.tripletnumbers, values.whichtriplet);
    values.orderpic2 = getitem(list.tripletnumbers, values.whichtriplet+1);
    values.orderpic3 = getitem(list.tripletnumbers, values.whichtriplet+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));
]
</trial>


**Lure trial**
<trial itemtimelure>
/ ontrialbegin = [
  list.tripletstart.reset();
    list.luretypes.reset();
    
    values.whichtriplet=list.tripletstart.nextvalue;
    values.whichluretype=list.luretypes.nextvalue;
    
  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.whichluretype=1){
        values.orderpic1 = getitem(list.tripletnumbers, values.whichtriplet+1);
        values.orderpic2 = getitem(list.tripletnumbers, values.whichtriplet);
        values.orderpic3 = getitem(list.tripletnumbers, values.whichtriplet+2);
        
   } elseif (values.whichluretype=2){
        values.orderpic1 = getitem(list.tripletnumbers, values.whichtriplet+2);
        values.orderpic2 = getitem(list.tripletnumbers, values.whichtriplet+1);
        values.orderpic3 = getitem(list.tripletnumbers, values.whichtriplet);
        
        } elseif (values.whichluretype=3){
        values.orderpic1 = getitem(list.tripletnumbers, values.whichtriplet);
        values.orderpic2 = getitem(list.tripletnumbers, values.whichtriplet+2);
        values.orderpic3 = getitem(list.tripletnumbers, values.whichtriplet+1);
        }
]
/ 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>


**************************************************************************************************************
**************************************************************************************************************
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-4=noreplace(itemitemtarget, itemitemlure)]

/ ontrialend = [
if (block.retrievalphase.responsetext == parameters.noKey){
 values.responseCategory = "no";
} else if (block.retrievalphase.responsetext == parameters.yesKey){
 values.responseCategory = "yes";
}
]
</block>



**************************************************************************************************************
**************************************************************************************************************
EXPERIMENT
**************************************************************************************************************
**************************************************************************************************************

<expt>
/ blocks = [1 = pairings; 2 = encodingphase; 3 = retrievalphase]
</expt>

I honestly have no clue what you're asking. Also, as far as I know, there is *one* test trial per retrieval phase in the TBT, not four test trials in a row. after the encoding phase The test trial is a either a target trial or a lure trial. So, this

"There are 4 triplets and 4 retrieval trials with 2 targets and 2 lures. Though the triplets to be shown are being picked randomly, the same triplets appear for both target trials and lure trials. I would like to make sure that for every retrieval trial a new triplet is picked and the test question is asked. "

does not really make sense and is not how the actual task works.


By aarthiravi - 2/23/2022

Sorry, I'll try to explain it better.

According to the code, in encodingphase block there are 32 study trials. In the retrieval phase block there is one target trial and one lure trial. However, there must be a total of 4 retrieval trials in the retievalphase, that is, 2 target and 2 lure. That is why I've put it as
/ trials = [1-4=noreplace(itemitemtarget, itemitemlure)].

For every itemitemtarget trial a new triplet is being chosen which is fine. For every itemitemlure trial a new triplet is chosen but with replacement. Meaning the triplet that's chosen for the lure trial is the same as thta in the target trial and thta is not what should be done.

What should happen: In the retrieval phase, each of the 4 trials (2 targets and 2 lures) should use one of the triplets ( out of 4) with no replacement.

Am I explaining it a little better this time?


By Dave - 2/23/2022

aarthiravi - 2/23/2022
Sorry, I'll try to explain it better.

According to the code, in encodingphase block there are 32 study trials. In the retrieval phase block there is one target trial and one lure trial. However, there must be a total of 4 retrieval trials in the retievalphase, that is, 2 target and 2 lure. That is why I've put it as
/ trials = [1-4=noreplace(itemitemtarget, itemitemlure)].

For every itemitemtarget trial a new triplet is being chosen which is fine. For every itemitemlure trial a new triplet is chosen but with replacement. Meaning the triplet that's chosen for the lure trial is the same as thta in the target trial and thta is not what should be done.

What should happen: In the retrieval phase, each of the 4 trials (2 targets and 2 lures) should use one of the triplets ( out of 4) with no replacement.

Am I explaining it a little better this time?



Again, the task does not work this way, to the best of my knowledge, and your structure is wrong, as in: that is not how the TBT procedure as described in the literature operates.