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


Storing stimuli and its locations to show the same stimuli once again...
Author
Message
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
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?


aarthiravi
aarthiravi
Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)
Group: Forum Members
Posts: 15, Visits: 133
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.
aarthiravi
aarthiravi
Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)
Group: Forum Members
Posts: 15, Visits: 133
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?
aarthiravi
aarthiravi
Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)
Group: Forum Members
Posts: 15, Visits: 133
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?
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
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.

aarthiravi
aarthiravi
Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)
Group: Forum Members
Posts: 15, Visits: 133
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!


aarthiravi
aarthiravi
Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)
Group: Forum Members
Posts: 15, Visits: 133
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>
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
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.



aarthiravi
aarthiravi
Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)Associate Member (240 reputation)
Group: Forum Members
Posts: 15, Visits: 133
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?



Edited 2 Years Ago by Dave
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
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.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search