Showing saved pairings of stimuli in different positions


Author
Message
lir1995
lir1995
Partner Member (831 reputation)Partner Member (831 reputation)Partner Member (831 reputation)Partner Member (831 reputation)Partner Member (831 reputation)Partner Member (831 reputation)Partner Member (831 reputation)Partner Member (831 reputation)Partner Member (831 reputation)
Group: Forum Members
Posts: 44, Visits: 201
Hello, 

I have an experiment where participants study faces and scenes, and will then be tested on their memory for the face scene pairings (study1-test1-study2-test2). I was able to get the study part working, where faces and scenes are initially randomly paired together during study1. During study2 the same scene-face pairings are presented again. 

However, we are having trouble with the test portion. For the study portion, the face and scene are presented next to each other (horizontal). However, for the test portion, One scene is presented in the top middle of the screen with three faces underneath.  In the test , we need the correct face to be presented with the correct scene, in addition to two additional faces. Here are two issues we are facing: 

1. The way we have it coded now, the pairings are saved with the scenes and faces in a specific, horizontal position. How do we show the same scene-face pairing from the study phase (horizontal) in the test phase with the scene on top of the face?

2. Ideally, the face choices would be the face initially paired with the scene, one random face, and one that was paired with a pairmate of the correct answer scene (arcade 1 and arcade 2). Right now we just have all of the scenes listed out in one item element and not grouped together by pairmates. Though they are ordered by pairmates (e.g., 1 & 2 go together, 3 & 4 together, etc.).  Is it possibly to have the test phase have The scene on top, and then three faces on the bottom that include: faces from the correct scene, its pairmate, and then a random face? If this is not possible, we need it so the other two faces are random and not the same as each other. 

Here is the code we have so far with a working study phase and in progress test phase. Any help is very much appreciated. Thank you for your time.

**************
STIMULI
**************
************
Import Faces
************
<item Face>
  / 1 = "Faces/1.jpg"
  / 2 = "Faces/2.jpg"
  / 3 = "Faces/3.jpg"
  / 4 = "Faces/4.jpg"
  / 5 = "Faces/5.jpg"
  / 6 = "Faces/6.jpg"
  / 7 = "Faces/7.jpg"
  / 8 = "Faces/8.jpg"
  / 9 = "Faces/9.jpg"
  / 10 = "Faces/10.jpg"
</item>
******
Values
******
<values>
/ Facevalue = 1
/ everythingvalue = 1
</values>
# used for randomization
****
List
****
<list randomface>
/ poolsize = 10
</list>
<list randomscene>
/ poolsize = 10
</list>
<list repeatface>
</list>
<list repeatscene>
/ selectionmode = list.repeatface.currentindex
</list>
*************
Locate Scenes
*************
<item everything>
/1 = "scene_files_test/Scenes/Arcade 1.jpg"
/2 = "scene_files_test/Scenes/Arcade 2.jpg"
/3 = "scene_files_test/Scenes/Auditorium 1.jpg"
/4 = "scene_files_test/Scenes/Auditorium 2.jpg"
/5 = "scene_files_test/Scenes/Bridge 1.jpg"
/6 = "scene_files_test/Scenes/Bridge 2.jpg"
/7 = "scene_files_test/Scenes/Dock 1.jpg"
/8 = "scene_files_test/Scenes/Dock 2.jpg"
/9 = "scene_files_test/Scenes/Hallway 1.jpg"
/10 = "scene_files_test/Scenes/Hallway 2.jpg"
</item>
****************
Picture Elements
****************
#STUDY PHASE

<picture face_pictured_2>
/ items = Face
/ position = (27%, 50%)
/ size = (50%, 50%)
/ select = values.Facevalue
</picture>

<picture scene1_display>
/ items = everything
/ position = (70%, 50%)
/ size = (50%, 50%)
/ select = values.everythingvalue
</picture>
#for the scenes in the first part


##TEST PHASE

<picture face_pictured_3>
/ items = Face
/ position = (20%, 80%)
/ size = (30%, 30%)
</picture>
# one face above and three scenes below (second part)

<picture face_pictured_4>
/ items = Face
/ position = (50%, 80%)
/ size = (30%, 30%)
</picture>
# one face above and three scenes below (second part)

<picture face_pictured_5>
/ items = Face
/ position = (80%, 80%)
/ size = (30%, 30%)
</picture>
# one face above and three scenes below (second part)


<picture scene2_display>
  / items = everything
  / position = (50%, 30%)
  / size = (50%, 50%)
</picture>
#for the scenes in the second part


<shape blank>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
/ erase = false
</shape>

***************
Creating Trials
***************
##STUDY PHASES
<trial Face_and_Scene_show>
/ ontrialbegin = [values.Facevalue=list.randomface.nextindex; values.everythingvalue=list.randomscene.nextindex;
  list.repeatface.appenditem(values.Facevalue); list.repeatscene.appenditem(values.everythingvalue); ]
  / stimulustimes = [
   0 = face_pictured_2;
   0 = scene1_display;
   3000 = blank;
  ]
  / timeout = 4000
  / validresponse = ("1", "2", "3")
  / inputdevice = keyboard
</trial>

<trial Face_and_Scene_repeat>
/ ontrialbegin = [values.Facevalue=list.repeatface.nextvalue; values.everythingvalue=list.repeatscene.nextvalue; ]
  / stimulustimes = [
   0 = face_pictured_2;
   0 = scene1_display;
   3000 = blank;
  ]
  / timeout = 4000
  / validresponse = ("1", "2", "3")
  / inputdevice = keyboard
</trial>
# one face and one scene next to each other (second part)

#TEST PHASE
<trial Face_and_Three_Scenes>
  / stimulustimes = [
   0 = scene2_display;
   0 = face_pictured_3;
   0 = face_pictured_4;
   0 = face_pictured_5;
  ]
  / timeout = 5000
  / validresponse = ("1", "2", "3")
  / inputdevice = keyboard
</trial>
# one face above and three scenes below (third part)
***************
Creating Blocks
***************
<block Show>
/ trials = [1-10 = Face_and_Scene_show]
</block>
# indicates the from Face1, we want four images to be shown (1-4) -> if there aren't four images listed, the code will alternate between the listed ones (ex. switch between one, two, one, two)
# the images are shown in a random order

<block Response>
/ trials = [1-10 = Face_and_Three_Scenes]
</block>

<block Repeat>
/ trials = [1-10 = Face_and_Scene_repeat]
</block>
***********
Experiment
***********
<expt>
/ blocks = [1 = Show; 2 = Response; 3 = Repeat; 4 = Response]
</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: 13K, Visits: 104K
lir1995 - 11/21/2024
Hello, 

I have an experiment where participants study faces and scenes, and will then be tested on their memory for the face scene pairings (study1-test1-study2-test2). I was able to get the study part working, where faces and scenes are initially randomly paired together during study1. During study2 the same scene-face pairings are presented again. 

However, we are having trouble with the test portion. For the study portion, the face and scene are presented next to each other (horizontal). However, for the test portion, One scene is presented in the top middle of the screen with three faces underneath.  In the test , we need the correct face to be presented with the correct scene, in addition to two additional faces. Here are two issues we are facing: 

1. The way we have it coded now, the pairings are saved with the scenes and faces in a specific, horizontal position. How do we show the same scene-face pairing from the study phase (horizontal) in the test phase with the scene on top of the face?

2. Ideally, the face choices would be the face initially paired with the scene, one random face, and one that was paired with a pairmate of the correct answer scene (arcade 1 and arcade 2). Right now we just have all of the scenes listed out in one item element and not grouped together by pairmates. Though they are ordered by pairmates (e.g., 1 & 2 go together, 3 & 4 together, etc.).  Is it possibly to have the test phase have The scene on top, and then three faces on the bottom that include: faces from the correct scene, its pairmate, and then a random face? If this is not possible, we need it so the other two faces are random and not the same as each other. 

Here is the code we have so far with a working study phase and in progress test phase. Any help is very much appreciated. Thank you for your time.

**************
STIMULI
**************
************
Import Faces
************
<item Face>
  / 1 = "Faces/1.jpg"
  / 2 = "Faces/2.jpg"
  / 3 = "Faces/3.jpg"
  / 4 = "Faces/4.jpg"
  / 5 = "Faces/5.jpg"
  / 6 = "Faces/6.jpg"
  / 7 = "Faces/7.jpg"
  / 8 = "Faces/8.jpg"
  / 9 = "Faces/9.jpg"
  / 10 = "Faces/10.jpg"
</item>
******
Values
******
<values>
/ Facevalue = 1
/ everythingvalue = 1
</values>
# used for randomization
****
List
****
<list randomface>
/ poolsize = 10
</list>
<list randomscene>
/ poolsize = 10
</list>
<list repeatface>
</list>
<list repeatscene>
/ selectionmode = list.repeatface.currentindex
</list>
*************
Locate Scenes
*************
<item everything>
/1 = "scene_files_test/Scenes/Arcade 1.jpg"
/2 = "scene_files_test/Scenes/Arcade 2.jpg"
/3 = "scene_files_test/Scenes/Auditorium 1.jpg"
/4 = "scene_files_test/Scenes/Auditorium 2.jpg"
/5 = "scene_files_test/Scenes/Bridge 1.jpg"
/6 = "scene_files_test/Scenes/Bridge 2.jpg"
/7 = "scene_files_test/Scenes/Dock 1.jpg"
/8 = "scene_files_test/Scenes/Dock 2.jpg"
/9 = "scene_files_test/Scenes/Hallway 1.jpg"
/10 = "scene_files_test/Scenes/Hallway 2.jpg"
</item>
****************
Picture Elements
****************
#STUDY PHASE

<picture face_pictured_2>
/ items = Face
/ position = (27%, 50%)
/ size = (50%, 50%)
/ select = values.Facevalue
</picture>

<picture scene1_display>
/ items = everything
/ position = (70%, 50%)
/ size = (50%, 50%)
/ select = values.everythingvalue
</picture>
#for the scenes in the first part


##TEST PHASE

<picture face_pictured_3>
/ items = Face
/ position = (20%, 80%)
/ size = (30%, 30%)
</picture>
# one face above and three scenes below (second part)

<picture face_pictured_4>
/ items = Face
/ position = (50%, 80%)
/ size = (30%, 30%)
</picture>
# one face above and three scenes below (second part)

<picture face_pictured_5>
/ items = Face
/ position = (80%, 80%)
/ size = (30%, 30%)
</picture>
# one face above and three scenes below (second part)


<picture scene2_display>
  / items = everything
  / position = (50%, 30%)
  / size = (50%, 50%)
</picture>
#for the scenes in the second part


<shape blank>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
/ erase = false
</shape>

***************
Creating Trials
***************
##STUDY PHASES
<trial Face_and_Scene_show>
/ ontrialbegin = [values.Facevalue=list.randomface.nextindex; values.everythingvalue=list.randomscene.nextindex;
  list.repeatface.appenditem(values.Facevalue); list.repeatscene.appenditem(values.everythingvalue); ]
  / stimulustimes = [
   0 = face_pictured_2;
   0 = scene1_display;
   3000 = blank;
  ]
  / timeout = 4000
  / validresponse = ("1", "2", "3")
  / inputdevice = keyboard
</trial>

<trial Face_and_Scene_repeat>
/ ontrialbegin = [values.Facevalue=list.repeatface.nextvalue; values.everythingvalue=list.repeatscene.nextvalue; ]
  / stimulustimes = [
   0 = face_pictured_2;
   0 = scene1_display;
   3000 = blank;
  ]
  / timeout = 4000
  / validresponse = ("1", "2", "3")
  / inputdevice = keyboard
</trial>
# one face and one scene next to each other (second part)

#TEST PHASE
<trial Face_and_Three_Scenes>
  / stimulustimes = [
   0 = scene2_display;
   0 = face_pictured_3;
   0 = face_pictured_4;
   0 = face_pictured_5;
  ]
  / timeout = 5000
  / validresponse = ("1", "2", "3")
  / inputdevice = keyboard
</trial>
# one face above and three scenes below (third part)
***************
Creating Blocks
***************
<block Show>
/ trials = [1-10 = Face_and_Scene_show]
</block>
# indicates the from Face1, we want four images to be shown (1-4) -> if there aren't four images listed, the code will alternate between the listed ones (ex. switch between one, two, one, two)
# the images are shown in a random order

<block Response>
/ trials = [1-10 = Face_and_Three_Scenes]
</block>

<block Repeat>
/ trials = [1-10 = Face_and_Scene_repeat]
</block>
***********
Experiment
***********
<expt>
/ blocks = [1 = Show; 2 = Response; 3 = Repeat; 4 = Response]
</expt>



(1) Please comment your code: Meaningful explanations of what each part is supposed to do.
(2) If your code requires external files to run (images, etc.) always provide those files along with it.
(3) In your questions, refer to any and all elements as they are named in the code. Otherwise it is difficult to discern what you are referring to.
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: 13K, Visits: 104K
Dave - 11/21/2024
lir1995 - 11/21/2024
Hello, 

I have an experiment where participants study faces and scenes, and will then be tested on their memory for the face scene pairings (study1-test1-study2-test2). I was able to get the study part working, where faces and scenes are initially randomly paired together during study1. During study2 the same scene-face pairings are presented again. 

However, we are having trouble with the test portion. For the study portion, the face and scene are presented next to each other (horizontal). However, for the test portion, One scene is presented in the top middle of the screen with three faces underneath.  In the test , we need the correct face to be presented with the correct scene, in addition to two additional faces. Here are two issues we are facing: 

1. The way we have it coded now, the pairings are saved with the scenes and faces in a specific, horizontal position. How do we show the same scene-face pairing from the study phase (horizontal) in the test phase with the scene on top of the face?

2. Ideally, the face choices would be the face initially paired with the scene, one random face, and one that was paired with a pairmate of the correct answer scene (arcade 1 and arcade 2). Right now we just have all of the scenes listed out in one item element and not grouped together by pairmates. Though they are ordered by pairmates (e.g., 1 & 2 go together, 3 & 4 together, etc.).  Is it possibly to have the test phase have The scene on top, and then three faces on the bottom that include: faces from the correct scene, its pairmate, and then a random face? If this is not possible, we need it so the other two faces are random and not the same as each other. 

Here is the code we have so far with a working study phase and in progress test phase. Any help is very much appreciated. Thank you for your time.

**************
STIMULI
**************
************
Import Faces
************
<item Face>
  / 1 = "Faces/1.jpg"
  / 2 = "Faces/2.jpg"
  / 3 = "Faces/3.jpg"
  / 4 = "Faces/4.jpg"
  / 5 = "Faces/5.jpg"
  / 6 = "Faces/6.jpg"
  / 7 = "Faces/7.jpg"
  / 8 = "Faces/8.jpg"
  / 9 = "Faces/9.jpg"
  / 10 = "Faces/10.jpg"
</item>
******
Values
******
<values>
/ Facevalue = 1
/ everythingvalue = 1
</values>
# used for randomization
****
List
****
<list randomface>
/ poolsize = 10
</list>
<list randomscene>
/ poolsize = 10
</list>
<list repeatface>
</list>
<list repeatscene>
/ selectionmode = list.repeatface.currentindex
</list>
*************
Locate Scenes
*************
<item everything>
/1 = "scene_files_test/Scenes/Arcade 1.jpg"
/2 = "scene_files_test/Scenes/Arcade 2.jpg"
/3 = "scene_files_test/Scenes/Auditorium 1.jpg"
/4 = "scene_files_test/Scenes/Auditorium 2.jpg"
/5 = "scene_files_test/Scenes/Bridge 1.jpg"
/6 = "scene_files_test/Scenes/Bridge 2.jpg"
/7 = "scene_files_test/Scenes/Dock 1.jpg"
/8 = "scene_files_test/Scenes/Dock 2.jpg"
/9 = "scene_files_test/Scenes/Hallway 1.jpg"
/10 = "scene_files_test/Scenes/Hallway 2.jpg"
</item>
****************
Picture Elements
****************
#STUDY PHASE

<picture face_pictured_2>
/ items = Face
/ position = (27%, 50%)
/ size = (50%, 50%)
/ select = values.Facevalue
</picture>

<picture scene1_display>
/ items = everything
/ position = (70%, 50%)
/ size = (50%, 50%)
/ select = values.everythingvalue
</picture>
#for the scenes in the first part


##TEST PHASE

<picture face_pictured_3>
/ items = Face
/ position = (20%, 80%)
/ size = (30%, 30%)
</picture>
# one face above and three scenes below (second part)

<picture face_pictured_4>
/ items = Face
/ position = (50%, 80%)
/ size = (30%, 30%)
</picture>
# one face above and three scenes below (second part)

<picture face_pictured_5>
/ items = Face
/ position = (80%, 80%)
/ size = (30%, 30%)
</picture>
# one face above and three scenes below (second part)


<picture scene2_display>
  / items = everything
  / position = (50%, 30%)
  / size = (50%, 50%)
</picture>
#for the scenes in the second part


<shape blank>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
/ erase = false
</shape>

***************
Creating Trials
***************
##STUDY PHASES
<trial Face_and_Scene_show>
/ ontrialbegin = [values.Facevalue=list.randomface.nextindex; values.everythingvalue=list.randomscene.nextindex;
  list.repeatface.appenditem(values.Facevalue); list.repeatscene.appenditem(values.everythingvalue); ]
  / stimulustimes = [
   0 = face_pictured_2;
   0 = scene1_display;
   3000 = blank;
  ]
  / timeout = 4000
  / validresponse = ("1", "2", "3")
  / inputdevice = keyboard
</trial>

<trial Face_and_Scene_repeat>
/ ontrialbegin = [values.Facevalue=list.repeatface.nextvalue; values.everythingvalue=list.repeatscene.nextvalue; ]
  / stimulustimes = [
   0 = face_pictured_2;
   0 = scene1_display;
   3000 = blank;
  ]
  / timeout = 4000
  / validresponse = ("1", "2", "3")
  / inputdevice = keyboard
</trial>
# one face and one scene next to each other (second part)

#TEST PHASE
<trial Face_and_Three_Scenes>
  / stimulustimes = [
   0 = scene2_display;
   0 = face_pictured_3;
   0 = face_pictured_4;
   0 = face_pictured_5;
  ]
  / timeout = 5000
  / validresponse = ("1", "2", "3")
  / inputdevice = keyboard
</trial>
# one face above and three scenes below (third part)
***************
Creating Blocks
***************
<block Show>
/ trials = [1-10 = Face_and_Scene_show]
</block>
# indicates the from Face1, we want four images to be shown (1-4) -> if there aren't four images listed, the code will alternate between the listed ones (ex. switch between one, two, one, two)
# the images are shown in a random order

<block Response>
/ trials = [1-10 = Face_and_Three_Scenes]
</block>

<block Repeat>
/ trials = [1-10 = Face_and_Scene_repeat]
</block>
***********
Experiment
***********
<expt>
/ blocks = [1 = Show; 2 = Response; 3 = Repeat; 4 = Response]
</expt>



(1) Please comment your code: Meaningful explanations of what each part is supposed to do.
(2) If your code requires external files to run (images, etc.) always provide those files along with it.
(3) In your questions, refer to any and all elements as they are named in the code. Otherwise it is difficult to discern what you are referring to.

Here's how I would set this up, so far as I can make sense of your description. You didn't provide the images, so I had to resort to using <text> elements as placeholders.

<expt a>
/ onexptbegin = [
    // set up the scene-face-pairings
    var i = 1;
    while (i < 11) {
        var currentFace = list.faceItemnumbers.nextindex; // pick a face at random
        list.scenePairedFaceItemnumbers.setitem(currentFace, i); // pair it with scene i
        if (mod(i, 2) == 1) { // if i is odd
            list.scenePairmateFaceItemnumbers.setitem(currentFace, i+1); // the face is the pairmate for scene i+1
        } else { // otherwise
            list.scenePairmateFaceItemnumbers.setitem(currentFace, i-1); // the face is the pairmate for scene i-1
        };
        i += 1;
    };
]
/ blocks = [1-2 = sequence(study, test)] // study -> test -> study -> test
</expt>

<values>
/ sceneItemnumber = 0 // item number of current scene
/ scenePairedFaceItemnumber = 0 // item number scene-paired face
/ scenePairmateFaceItemnumber = 0 // item number of pairmate-paired face
/ sceneUnrelatedFaceItemnumber = 0 // item number of unrlated face (not scene- or pairmate-paired)

/ scenePairedFacePositionnumber = 0 // in which position the scene-paired face is located
/ scenePairmateFacePositionnumber = 0 // in which position the pairmate-paired face is located
/ sceneUnrelatedFacePositionnumber = 0 // in which position the scene-unrelated face is located
</values>

// study phase
<block study>
/ trials = [1-10 = studyTrial] // 10 trials
</block>

<trial studyTrial>
/ ontrialbegin = [
    values.sceneItemnumber = list.sceneItemNumbers.nextvalue; // pick scene to study
    values.scenePairedFaceItemnumber = list.scenePairedFaceItemnumbers.nextvalue; // pick face paired to scene
]
/ stimulustimes = [0=studyScene, studyFace; 3000=clearscreen]
/ trialduration = 4000
/ validresponse = (0)
</trial>

<text studyFace>
/ items = faceItems
/ position = (27%, 50%)
/ select = values.scenePairedFaceItemnumber
</text>

<text studyScene>
/ items = sceneItems
/ position = (70%, 50%)
/ select = values.sceneItemnumber
</text>

// test phase
<block test>
/ trials = [1-10 = testTrial] // 10 trials
</block>

<trial testTrial>
/ ontrialbegin = [
    // pick scene to test and associated faces
    values.sceneItemnumber = list.sceneItemNumbers.nextvalue; // pick scene to test
    values.scenePairedFaceItemnumber = list.scenePairedFaceItemnumbers.nextvalue; // pick face paired to scene
    values.scenePairmateFaceItemnumber = list.scenePairmateFaceItemnumbers.nextvalue; // pick face paired to its pairmate scene
    values.sceneUnrelatedFaceItemnumber = list.sceneUnrelatedFaceItemnumbers.nextvalue; // pick a unrelated face out of the remaining (not current scene-paired or pairmate-paired)
    // randomize horizontal position of scene-paired face, pairmate-paired face, and unrelated random face
    values.scenePairedFacePositionnumber = list.testFacePositionNumbers.nextvalue;
    text.testScenePairedFace.hposition = list.positions.item(values.scenePairedFacePositionnumber);
    values.scenePairmateFacePositionnumber = list.testFacePositionNumbers.nextvalue;
    text.testScenePairmateFace.hposition = list.positions.item(values.scenePairmateFacePositionnumber);
    values.sceneUnrelatedFacePositionnumber = list.testFacePositionNumbers.nextvalue;
    text.testSceneUnrelatedFace.hposition = list.positions.item(values.sceneUnrelatedFacePositionnumber);
    ]
/ stimulustimes = [0=testScene, testScenePairedFace, testScenePairmateFace, testSceneUnrelatedFace]
/ validresponse = ("1", "2", "3")
/ iscorrectresponse = [
    trial.testTrial.responsetext == values.scenePairedFacePositionNumber; // correct if position of scene-paired face identified
]
/ timeout = 5000
</trial>

<text testScene>
/ items = sceneItems
/ position = (50%, 10%)
/ select = values.sceneItemnumber
</text>

<text testScenePairedFace>
/ items = faceItems
/ select = values.scenePairedFaceItemnumber
/ vposition = 80%
</text>

<text testScenePairmateFace>
/ items = faceItems
/ select = values.scenePairmateFaceItemnumber
/ vposition = 80%
</text>

<text testSceneUnrelatedFace>
/ items = faceItems
/ select = values.sceneUnrelatedFaceItemnumber
/ vposition = 80%
</text>

<item faceItems>
/ 1 = "Faces/1.jpg"
/ 2 = "Faces/2.jpg"
/ 3 = "Faces/3.jpg"
/ 4 = "Faces/4.jpg"
/ 5 = "Faces/5.jpg"
/ 6 = "Faces/6.jpg"
/ 7 = "Faces/7.jpg"
/ 8 = "Faces/8.jpg"
/ 9 = "Faces/9.jpg"
/ 10 = "Faces/10.jpg"
</item>

<item sceneItems>
/1 = "scene_files_test/Scenes/Arcade 1.jpg"
/2 = "scene_files_test/Scenes/Arcade 2.jpg"
/3 = "scene_files_test/Scenes/Auditorium 1.jpg"
/4 = "scene_files_test/Scenes/Auditorium 2.jpg"
/5 = "scene_files_test/Scenes/Bridge 1.jpg"
/6 = "scene_files_test/Scenes/Bridge 2.jpg"
/7 = "scene_files_test/Scenes/Dock 1.jpg"
/8 = "scene_files_test/Scenes/Dock 2.jpg"
/9 = "scene_files_test/Scenes/Hallway 1.jpg"
/10 = "scene_files_test/Scenes/Hallway 2.jpg"
</item>

<list faceItemnumbers>
/ poolsize = 10
/ selectionrate = always
</list>

<list sceneItemNumbers>
/ items = (1,2,3,4,5,6,7,8,9,10)
</list>

<list scenePairedFaceItemnumbers>
/ items = (0,0,0,0,0,0,0,0,0,0) // set onextbegin
/ selectionmode = list.sceneItemNumbers.currentindex
</list>

<list scenePairmateFaceItemnumbers>
/ items = (0,0,0,0,0,0,0,0,0,0) // set onexptbegin
/ selectionmode = list.sceneItemNumbers.currentindex
</list>

<list sceneUnrelatedFaceItemnumbers>
/ items = (1,2,3,4,5,6,7,8,9,10)
/ not = (values.scenePairedFaceItemnumber)
/ not = (values.scenePairmateFaceItemnumber)
/ selectionrate = always
</list>

<list testFacePositionNumbers>
/ items = (1,2,3)
/ selectionrate = always
</list>

<list positions>
/ items = (20%, 50%, 80%)
</list>

<data>
/ columns = (
    date time subject group session blocknum blockcode trialnum trialcode stimulusitem stimulusitem stimulusitem stimulusitem
    response responsetext latency correct
    values.sceneItemnumber values.scenePairedFaceItemnumber values.scenePairmateFaceItemnumber values.sceneUnrelatedFaceItemnumber
    values.scenePairedFacePositionnumber values.scenePairmateFacePositionnumber values.sceneUnrelatedFacePositionnumber
    )
</data>


Edited Last Month by Dave
lir1995
lir1995
Partner Member (831 reputation)Partner Member (831 reputation)Partner Member (831 reputation)Partner Member (831 reputation)Partner Member (831 reputation)Partner Member (831 reputation)Partner Member (831 reputation)Partner Member (831 reputation)Partner Member (831 reputation)
Group: Forum Members
Posts: 44, Visits: 201
Dave - 11/22/2024
Dave - 11/21/2024
lir1995 - 11/21/2024
Hello, 

I have an experiment where participants study faces and scenes, and will then be tested on their memory for the face scene pairings (study1-test1-study2-test2). I was able to get the study part working, where faces and scenes are initially randomly paired together during study1. During study2 the same scene-face pairings are presented again. 

However, we are having trouble with the test portion. For the study portion, the face and scene are presented next to each other (horizontal). However, for the test portion, One scene is presented in the top middle of the screen with three faces underneath.  In the test , we need the correct face to be presented with the correct scene, in addition to two additional faces. Here are two issues we are facing: 

1. The way we have it coded now, the pairings are saved with the scenes and faces in a specific, horizontal position. How do we show the same scene-face pairing from the study phase (horizontal) in the test phase with the scene on top of the face?

2. Ideally, the face choices would be the face initially paired with the scene, one random face, and one that was paired with a pairmate of the correct answer scene (arcade 1 and arcade 2). Right now we just have all of the scenes listed out in one item element and not grouped together by pairmates. Though they are ordered by pairmates (e.g., 1 & 2 go together, 3 & 4 together, etc.).  Is it possibly to have the test phase have The scene on top, and then three faces on the bottom that include: faces from the correct scene, its pairmate, and then a random face? If this is not possible, we need it so the other two faces are random and not the same as each other. 

Here is the code we have so far with a working study phase and in progress test phase. Any help is very much appreciated. Thank you for your time.

**************
STIMULI
**************
************
Import Faces
************
<item Face>
  / 1 = "Faces/1.jpg"
  / 2 = "Faces/2.jpg"
  / 3 = "Faces/3.jpg"
  / 4 = "Faces/4.jpg"
  / 5 = "Faces/5.jpg"
  / 6 = "Faces/6.jpg"
  / 7 = "Faces/7.jpg"
  / 8 = "Faces/8.jpg"
  / 9 = "Faces/9.jpg"
  / 10 = "Faces/10.jpg"
</item>
******
Values
******
<values>
/ Facevalue = 1
/ everythingvalue = 1
</values>
# used for randomization
****
List
****
<list randomface>
/ poolsize = 10
</list>
<list randomscene>
/ poolsize = 10
</list>
<list repeatface>
</list>
<list repeatscene>
/ selectionmode = list.repeatface.currentindex
</list>
*************
Locate Scenes
*************
<item everything>
/1 = "scene_files_test/Scenes/Arcade 1.jpg"
/2 = "scene_files_test/Scenes/Arcade 2.jpg"
/3 = "scene_files_test/Scenes/Auditorium 1.jpg"
/4 = "scene_files_test/Scenes/Auditorium 2.jpg"
/5 = "scene_files_test/Scenes/Bridge 1.jpg"
/6 = "scene_files_test/Scenes/Bridge 2.jpg"
/7 = "scene_files_test/Scenes/Dock 1.jpg"
/8 = "scene_files_test/Scenes/Dock 2.jpg"
/9 = "scene_files_test/Scenes/Hallway 1.jpg"
/10 = "scene_files_test/Scenes/Hallway 2.jpg"
</item>
****************
Picture Elements
****************
#STUDY PHASE

<picture face_pictured_2>
/ items = Face
/ position = (27%, 50%)
/ size = (50%, 50%)
/ select = values.Facevalue
</picture>

<picture scene1_display>
/ items = everything
/ position = (70%, 50%)
/ size = (50%, 50%)
/ select = values.everythingvalue
</picture>
#for the scenes in the first part


##TEST PHASE

<picture face_pictured_3>
/ items = Face
/ position = (20%, 80%)
/ size = (30%, 30%)
</picture>
# one face above and three scenes below (second part)

<picture face_pictured_4>
/ items = Face
/ position = (50%, 80%)
/ size = (30%, 30%)
</picture>
# one face above and three scenes below (second part)

<picture face_pictured_5>
/ items = Face
/ position = (80%, 80%)
/ size = (30%, 30%)
</picture>
# one face above and three scenes below (second part)


<picture scene2_display>
  / items = everything
  / position = (50%, 30%)
  / size = (50%, 50%)
</picture>
#for the scenes in the second part


<shape blank>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
/ erase = false
</shape>

***************
Creating Trials
***************
##STUDY PHASES
<trial Face_and_Scene_show>
/ ontrialbegin = [values.Facevalue=list.randomface.nextindex; values.everythingvalue=list.randomscene.nextindex;
  list.repeatface.appenditem(values.Facevalue); list.repeatscene.appenditem(values.everythingvalue); ]
  / stimulustimes = [
   0 = face_pictured_2;
   0 = scene1_display;
   3000 = blank;
  ]
  / timeout = 4000
  / validresponse = ("1", "2", "3")
  / inputdevice = keyboard
</trial>

<trial Face_and_Scene_repeat>
/ ontrialbegin = [values.Facevalue=list.repeatface.nextvalue; values.everythingvalue=list.repeatscene.nextvalue; ]
  / stimulustimes = [
   0 = face_pictured_2;
   0 = scene1_display;
   3000 = blank;
  ]
  / timeout = 4000
  / validresponse = ("1", "2", "3")
  / inputdevice = keyboard
</trial>
# one face and one scene next to each other (second part)

#TEST PHASE
<trial Face_and_Three_Scenes>
  / stimulustimes = [
   0 = scene2_display;
   0 = face_pictured_3;
   0 = face_pictured_4;
   0 = face_pictured_5;
  ]
  / timeout = 5000
  / validresponse = ("1", "2", "3")
  / inputdevice = keyboard
</trial>
# one face above and three scenes below (third part)
***************
Creating Blocks
***************
<block Show>
/ trials = [1-10 = Face_and_Scene_show]
</block>
# indicates the from Face1, we want four images to be shown (1-4) -> if there aren't four images listed, the code will alternate between the listed ones (ex. switch between one, two, one, two)
# the images are shown in a random order

<block Response>
/ trials = [1-10 = Face_and_Three_Scenes]
</block>

<block Repeat>
/ trials = [1-10 = Face_and_Scene_repeat]
</block>
***********
Experiment
***********
<expt>
/ blocks = [1 = Show; 2 = Response; 3 = Repeat; 4 = Response]
</expt>



(1) Please comment your code: Meaningful explanations of what each part is supposed to do.
(2) If your code requires external files to run (images, etc.) always provide those files along with it.
(3) In your questions, refer to any and all elements as they are named in the code. Otherwise it is difficult to discern what you are referring to.

Here's how I would set this up, so far as I can make sense of your description. You didn't provide the images, so I had to resort to using <text> elements as placeholders.

<expt a>
/ onexptbegin = [
    // set up the scene-face-pairings
    var i = 1;
    while (i < 11) {
        var currentFace = list.faceItemnumbers.nextindex; // pick a face at random
        list.scenePairedFaceItemnumbers.setitem(currentFace, i); // pair it with scene i
        if (mod(i, 2) == 1) { // if i is odd
            list.scenePairmateFaceItemnumbers.setitem(currentFace, i+1); // the face is the pairmate for scene i+1
        } else { // otherwise
            list.scenePairmateFaceItemnumbers.setitem(currentFace, i-1); // the face is the pairmate for scene i-1
        };
        i += 1;
    };
]
/ blocks = [1-2 = sequence(study, test)] // study -> test -> study -> test
</expt>

<values>
/ sceneItemnumber = 0 // item number of current scene
/ scenePairedFaceItemnumber = 0 // item number scene-paired face
/ scenePairmateFaceItemnumber = 0 // item number of pairmate-paired face
/ sceneUnrelatedFaceItemnumber = 0 // item number of unrlated face (not scene- or pairmate-paired)

/ scenePairedFacePositionnumber = 0 // in which position the scene-paired face is located
/ scenePairmateFacePositionnumber = 0 // in which position the pairmate-paired face is located
/ sceneUnrelatedFacePositionnumber = 0 // in which position the scene-unrelated face is located
</values>

// study phase
<block study>
/ trials = [1-10 = studyTrial] // 10 trials
</block>

<trial studyTrial>
/ ontrialbegin = [
    values.sceneItemnumber = list.sceneItemNumbers.nextvalue; // pick scene to study
    values.scenePairedFaceItemnumber = list.scenePairedFaceItemnumbers.nextvalue; // pick face paired to scene
]
/ stimulustimes = [0=studyScene, studyFace; 3000=clearscreen]
/ trialduration = 4000
/ validresponse = (0)
</trial>

<text studyFace>
/ items = faceItems
/ position = (27%, 50%)
/ select = values.scenePairedFaceItemnumber
</text>

<text studyScene>
/ items = sceneItems
/ position = (70%, 50%)
/ select = values.sceneItemnumber
</text>

// test phase
<block test>
/ trials = [1-10 = testTrial] // 10 trials
</block>

<trial testTrial>
/ ontrialbegin = [
    // pick scene to test and associated faces
    values.sceneItemnumber = list.sceneItemNumbers.nextvalue; // pick scene to test
    values.scenePairedFaceItemnumber = list.scenePairedFaceItemnumbers.nextvalue; // pick face paired to scene
    values.scenePairmateFaceItemnumber = list.scenePairmateFaceItemnumbers.nextvalue; // pick face paired to its pairmate scene
    values.sceneUnrelatedFaceItemnumber = list.sceneUnrelatedFaceItemnumbers.nextvalue; // pick a unrelated face out of the remaining (not current scene-paired or pairmate-paired)
    // randomize horizontal position of scene-paired face, pairmate-paired face, and unrelated random face
    values.scenePairedFacePositionnumber = list.testFacePositionNumbers.nextvalue;
    text.testScenePairedFace.hposition = list.positions.item(values.scenePairedFacePositionnumber);
    values.scenePairmateFacePositionnumber = list.testFacePositionNumbers.nextvalue;
    text.testScenePairmateFace.hposition = list.positions.item(values.scenePairmateFacePositionnumber);
    values.sceneUnrelatedFacePositionnumber = list.testFacePositionNumbers.nextvalue;
    text.testSceneUnrelatedFace.hposition = list.positions.item(values.sceneUnrelatedFacePositionnumber);
    ]
/ stimulustimes = [0=testScene, testScenePairedFace, testScenePairmateFace, testSceneUnrelatedFace]
/ validresponse = ("1", "2", "3")
/ iscorrectresponse = [
    trial.testTrial.responsetext == values.scenePairedFacePositionNumber; // correct if position of scene-paired face identified
]
/ timeout = 5000
</trial>

<text testScene>
/ items = sceneItems
/ position = (50%, 10%)
/ select = values.sceneItemnumber
</text>

<text testScenePairedFace>
/ items = faceItems
/ select = values.scenePairedFaceItemnumber
/ vposition = 80%
</text>

<text testScenePairmateFace>
/ items = faceItems
/ select = values.scenePairmateFaceItemnumber
/ vposition = 80%
</text>

<text testSceneUnrelatedFace>
/ items = faceItems
/ select = values.sceneUnrelatedFaceItemnumber
/ vposition = 80%
</text>

<item faceItems>
/ 1 = "Faces/1.jpg"
/ 2 = "Faces/2.jpg"
/ 3 = "Faces/3.jpg"
/ 4 = "Faces/4.jpg"
/ 5 = "Faces/5.jpg"
/ 6 = "Faces/6.jpg"
/ 7 = "Faces/7.jpg"
/ 8 = "Faces/8.jpg"
/ 9 = "Faces/9.jpg"
/ 10 = "Faces/10.jpg"
</item>

<item sceneItems>
/1 = "scene_files_test/Scenes/Arcade 1.jpg"
/2 = "scene_files_test/Scenes/Arcade 2.jpg"
/3 = "scene_files_test/Scenes/Auditorium 1.jpg"
/4 = "scene_files_test/Scenes/Auditorium 2.jpg"
/5 = "scene_files_test/Scenes/Bridge 1.jpg"
/6 = "scene_files_test/Scenes/Bridge 2.jpg"
/7 = "scene_files_test/Scenes/Dock 1.jpg"
/8 = "scene_files_test/Scenes/Dock 2.jpg"
/9 = "scene_files_test/Scenes/Hallway 1.jpg"
/10 = "scene_files_test/Scenes/Hallway 2.jpg"
</item>

<list faceItemnumbers>
/ poolsize = 10
/ selectionrate = always
</list>

<list sceneItemNumbers>
/ items = (1,2,3,4,5,6,7,8,9,10)
</list>

<list scenePairedFaceItemnumbers>
/ items = (0,0,0,0,0,0,0,0,0,0) // set onextbegin
/ selectionmode = list.sceneItemNumbers.currentindex
</list>

<list scenePairmateFaceItemnumbers>
/ items = (0,0,0,0,0,0,0,0,0,0) // set onexptbegin
/ selectionmode = list.sceneItemNumbers.currentindex
</list>

<list sceneUnrelatedFaceItemnumbers>
/ items = (1,2,3,4,5,6,7,8,9,10)
/ not = (values.scenePairedFaceItemnumber)
/ not = (values.scenePairmateFaceItemnumber)
/ selectionrate = always
</list>

<list testFacePositionNumbers>
/ items = (1,2,3)
/ selectionrate = always
</list>

<list positions>
/ items = (20%, 50%, 80%)
</list>

<data>
/ columns = (
    date time subject group session blocknum blockcode trialnum trialcode stimulusitem stimulusitem stimulusitem stimulusitem
    response responsetext latency correct
    values.sceneItemnumber values.scenePairedFaceItemnumber values.scenePairmateFaceItemnumber values.sceneUnrelatedFaceItemnumber
    values.scenePairedFacePositionnumber values.scenePairmateFacePositionnumber values.sceneUnrelatedFacePositionnumber
    )
</data>


Thank you so much. I apologize for not providing the additional information you asked for in time. I appreciate you sending this code anyway. It works great except that in the study phase it is only ever picking Face 1. On each trial the scene-face pairing should be unique. 

Thanks again for any help.
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: 13K, Visits: 104K
lir1995 - 11/22/2024
Dave - 11/22/2024
Dave - 11/21/2024
lir1995 - 11/21/2024
Hello, 

I have an experiment where participants study faces and scenes, and will then be tested on their memory for the face scene pairings (study1-test1-study2-test2). I was able to get the study part working, where faces and scenes are initially randomly paired together during study1. During study2 the same scene-face pairings are presented again. 

However, we are having trouble with the test portion. For the study portion, the face and scene are presented next to each other (horizontal). However, for the test portion, One scene is presented in the top middle of the screen with three faces underneath.  In the test , we need the correct face to be presented with the correct scene, in addition to two additional faces. Here are two issues we are facing: 

1. The way we have it coded now, the pairings are saved with the scenes and faces in a specific, horizontal position. How do we show the same scene-face pairing from the study phase (horizontal) in the test phase with the scene on top of the face?

2. Ideally, the face choices would be the face initially paired with the scene, one random face, and one that was paired with a pairmate of the correct answer scene (arcade 1 and arcade 2). Right now we just have all of the scenes listed out in one item element and not grouped together by pairmates. Though they are ordered by pairmates (e.g., 1 & 2 go together, 3 & 4 together, etc.).  Is it possibly to have the test phase have The scene on top, and then three faces on the bottom that include: faces from the correct scene, its pairmate, and then a random face? If this is not possible, we need it so the other two faces are random and not the same as each other. 

Here is the code we have so far with a working study phase and in progress test phase. Any help is very much appreciated. Thank you for your time.

**************
STIMULI
**************
************
Import Faces
************
<item Face>
  / 1 = "Faces/1.jpg"
  / 2 = "Faces/2.jpg"
  / 3 = "Faces/3.jpg"
  / 4 = "Faces/4.jpg"
  / 5 = "Faces/5.jpg"
  / 6 = "Faces/6.jpg"
  / 7 = "Faces/7.jpg"
  / 8 = "Faces/8.jpg"
  / 9 = "Faces/9.jpg"
  / 10 = "Faces/10.jpg"
</item>
******
Values
******
<values>
/ Facevalue = 1
/ everythingvalue = 1
</values>
# used for randomization
****
List
****
<list randomface>
/ poolsize = 10
</list>
<list randomscene>
/ poolsize = 10
</list>
<list repeatface>
</list>
<list repeatscene>
/ selectionmode = list.repeatface.currentindex
</list>
*************
Locate Scenes
*************
<item everything>
/1 = "scene_files_test/Scenes/Arcade 1.jpg"
/2 = "scene_files_test/Scenes/Arcade 2.jpg"
/3 = "scene_files_test/Scenes/Auditorium 1.jpg"
/4 = "scene_files_test/Scenes/Auditorium 2.jpg"
/5 = "scene_files_test/Scenes/Bridge 1.jpg"
/6 = "scene_files_test/Scenes/Bridge 2.jpg"
/7 = "scene_files_test/Scenes/Dock 1.jpg"
/8 = "scene_files_test/Scenes/Dock 2.jpg"
/9 = "scene_files_test/Scenes/Hallway 1.jpg"
/10 = "scene_files_test/Scenes/Hallway 2.jpg"
</item>
****************
Picture Elements
****************
#STUDY PHASE

<picture face_pictured_2>
/ items = Face
/ position = (27%, 50%)
/ size = (50%, 50%)
/ select = values.Facevalue
</picture>

<picture scene1_display>
/ items = everything
/ position = (70%, 50%)
/ size = (50%, 50%)
/ select = values.everythingvalue
</picture>
#for the scenes in the first part


##TEST PHASE

<picture face_pictured_3>
/ items = Face
/ position = (20%, 80%)
/ size = (30%, 30%)
</picture>
# one face above and three scenes below (second part)

<picture face_pictured_4>
/ items = Face
/ position = (50%, 80%)
/ size = (30%, 30%)
</picture>
# one face above and three scenes below (second part)

<picture face_pictured_5>
/ items = Face
/ position = (80%, 80%)
/ size = (30%, 30%)
</picture>
# one face above and three scenes below (second part)


<picture scene2_display>
  / items = everything
  / position = (50%, 30%)
  / size = (50%, 50%)
</picture>
#for the scenes in the second part


<shape blank>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
/ erase = false
</shape>

***************
Creating Trials
***************
##STUDY PHASES
<trial Face_and_Scene_show>
/ ontrialbegin = [values.Facevalue=list.randomface.nextindex; values.everythingvalue=list.randomscene.nextindex;
  list.repeatface.appenditem(values.Facevalue); list.repeatscene.appenditem(values.everythingvalue); ]
  / stimulustimes = [
   0 = face_pictured_2;
   0 = scene1_display;
   3000 = blank;
  ]
  / timeout = 4000
  / validresponse = ("1", "2", "3")
  / inputdevice = keyboard
</trial>

<trial Face_and_Scene_repeat>
/ ontrialbegin = [values.Facevalue=list.repeatface.nextvalue; values.everythingvalue=list.repeatscene.nextvalue; ]
  / stimulustimes = [
   0 = face_pictured_2;
   0 = scene1_display;
   3000 = blank;
  ]
  / timeout = 4000
  / validresponse = ("1", "2", "3")
  / inputdevice = keyboard
</trial>
# one face and one scene next to each other (second part)

#TEST PHASE
<trial Face_and_Three_Scenes>
  / stimulustimes = [
   0 = scene2_display;
   0 = face_pictured_3;
   0 = face_pictured_4;
   0 = face_pictured_5;
  ]
  / timeout = 5000
  / validresponse = ("1", "2", "3")
  / inputdevice = keyboard
</trial>
# one face above and three scenes below (third part)
***************
Creating Blocks
***************
<block Show>
/ trials = [1-10 = Face_and_Scene_show]
</block>
# indicates the from Face1, we want four images to be shown (1-4) -> if there aren't four images listed, the code will alternate between the listed ones (ex. switch between one, two, one, two)
# the images are shown in a random order

<block Response>
/ trials = [1-10 = Face_and_Three_Scenes]
</block>

<block Repeat>
/ trials = [1-10 = Face_and_Scene_repeat]
</block>
***********
Experiment
***********
<expt>
/ blocks = [1 = Show; 2 = Response; 3 = Repeat; 4 = Response]
</expt>



(1) Please comment your code: Meaningful explanations of what each part is supposed to do.
(2) If your code requires external files to run (images, etc.) always provide those files along with it.
(3) In your questions, refer to any and all elements as they are named in the code. Otherwise it is difficult to discern what you are referring to.

Here's how I would set this up, so far as I can make sense of your description. You didn't provide the images, so I had to resort to using <text> elements as placeholders.

<expt a>
/ onexptbegin = [
    // set up the scene-face-pairings
    var i = 1;
    while (i < 11) {
        var currentFace = list.faceItemnumbers.nextindex; // pick a face at random
        list.scenePairedFaceItemnumbers.setitem(currentFace, i); // pair it with scene i
        if (mod(i, 2) == 1) { // if i is odd
            list.scenePairmateFaceItemnumbers.setitem(currentFace, i+1); // the face is the pairmate for scene i+1
        } else { // otherwise
            list.scenePairmateFaceItemnumbers.setitem(currentFace, i-1); // the face is the pairmate for scene i-1
        };
        i += 1;
    };
]
/ blocks = [1-2 = sequence(study, test)] // study -> test -> study -> test
</expt>

<values>
/ sceneItemnumber = 0 // item number of current scene
/ scenePairedFaceItemnumber = 0 // item number scene-paired face
/ scenePairmateFaceItemnumber = 0 // item number of pairmate-paired face
/ sceneUnrelatedFaceItemnumber = 0 // item number of unrlated face (not scene- or pairmate-paired)

/ scenePairedFacePositionnumber = 0 // in which position the scene-paired face is located
/ scenePairmateFacePositionnumber = 0 // in which position the pairmate-paired face is located
/ sceneUnrelatedFacePositionnumber = 0 // in which position the scene-unrelated face is located
</values>

// study phase
<block study>
/ trials = [1-10 = studyTrial] // 10 trials
</block>

<trial studyTrial>
/ ontrialbegin = [
    values.sceneItemnumber = list.sceneItemNumbers.nextvalue; // pick scene to study
    values.scenePairedFaceItemnumber = list.scenePairedFaceItemnumbers.nextvalue; // pick face paired to scene
]
/ stimulustimes = [0=studyScene, studyFace; 3000=clearscreen]
/ trialduration = 4000
/ validresponse = (0)
</trial>

<text studyFace>
/ items = faceItems
/ position = (27%, 50%)
/ select = values.scenePairedFaceItemnumber
</text>

<text studyScene>
/ items = sceneItems
/ position = (70%, 50%)
/ select = values.sceneItemnumber
</text>

// test phase
<block test>
/ trials = [1-10 = testTrial] // 10 trials
</block>

<trial testTrial>
/ ontrialbegin = [
    // pick scene to test and associated faces
    values.sceneItemnumber = list.sceneItemNumbers.nextvalue; // pick scene to test
    values.scenePairedFaceItemnumber = list.scenePairedFaceItemnumbers.nextvalue; // pick face paired to scene
    values.scenePairmateFaceItemnumber = list.scenePairmateFaceItemnumbers.nextvalue; // pick face paired to its pairmate scene
    values.sceneUnrelatedFaceItemnumber = list.sceneUnrelatedFaceItemnumbers.nextvalue; // pick a unrelated face out of the remaining (not current scene-paired or pairmate-paired)
    // randomize horizontal position of scene-paired face, pairmate-paired face, and unrelated random face
    values.scenePairedFacePositionnumber = list.testFacePositionNumbers.nextvalue;
    text.testScenePairedFace.hposition = list.positions.item(values.scenePairedFacePositionnumber);
    values.scenePairmateFacePositionnumber = list.testFacePositionNumbers.nextvalue;
    text.testScenePairmateFace.hposition = list.positions.item(values.scenePairmateFacePositionnumber);
    values.sceneUnrelatedFacePositionnumber = list.testFacePositionNumbers.nextvalue;
    text.testSceneUnrelatedFace.hposition = list.positions.item(values.sceneUnrelatedFacePositionnumber);
    ]
/ stimulustimes = [0=testScene, testScenePairedFace, testScenePairmateFace, testSceneUnrelatedFace]
/ validresponse = ("1", "2", "3")
/ iscorrectresponse = [
    trial.testTrial.responsetext == values.scenePairedFacePositionNumber; // correct if position of scene-paired face identified
]
/ timeout = 5000
</trial>

<text testScene>
/ items = sceneItems
/ position = (50%, 10%)
/ select = values.sceneItemnumber
</text>

<text testScenePairedFace>
/ items = faceItems
/ select = values.scenePairedFaceItemnumber
/ vposition = 80%
</text>

<text testScenePairmateFace>
/ items = faceItems
/ select = values.scenePairmateFaceItemnumber
/ vposition = 80%
</text>

<text testSceneUnrelatedFace>
/ items = faceItems
/ select = values.sceneUnrelatedFaceItemnumber
/ vposition = 80%
</text>

<item faceItems>
/ 1 = "Faces/1.jpg"
/ 2 = "Faces/2.jpg"
/ 3 = "Faces/3.jpg"
/ 4 = "Faces/4.jpg"
/ 5 = "Faces/5.jpg"
/ 6 = "Faces/6.jpg"
/ 7 = "Faces/7.jpg"
/ 8 = "Faces/8.jpg"
/ 9 = "Faces/9.jpg"
/ 10 = "Faces/10.jpg"
</item>

<item sceneItems>
/1 = "scene_files_test/Scenes/Arcade 1.jpg"
/2 = "scene_files_test/Scenes/Arcade 2.jpg"
/3 = "scene_files_test/Scenes/Auditorium 1.jpg"
/4 = "scene_files_test/Scenes/Auditorium 2.jpg"
/5 = "scene_files_test/Scenes/Bridge 1.jpg"
/6 = "scene_files_test/Scenes/Bridge 2.jpg"
/7 = "scene_files_test/Scenes/Dock 1.jpg"
/8 = "scene_files_test/Scenes/Dock 2.jpg"
/9 = "scene_files_test/Scenes/Hallway 1.jpg"
/10 = "scene_files_test/Scenes/Hallway 2.jpg"
</item>

<list faceItemnumbers>
/ poolsize = 10
/ selectionrate = always
</list>

<list sceneItemNumbers>
/ items = (1,2,3,4,5,6,7,8,9,10)
</list>

<list scenePairedFaceItemnumbers>
/ items = (0,0,0,0,0,0,0,0,0,0) // set onextbegin
/ selectionmode = list.sceneItemNumbers.currentindex
</list>

<list scenePairmateFaceItemnumbers>
/ items = (0,0,0,0,0,0,0,0,0,0) // set onexptbegin
/ selectionmode = list.sceneItemNumbers.currentindex
</list>

<list sceneUnrelatedFaceItemnumbers>
/ items = (1,2,3,4,5,6,7,8,9,10)
/ not = (values.scenePairedFaceItemnumber)
/ not = (values.scenePairmateFaceItemnumber)
/ selectionrate = always
</list>

<list testFacePositionNumbers>
/ items = (1,2,3)
/ selectionrate = always
</list>

<list positions>
/ items = (20%, 50%, 80%)
</list>

<data>
/ columns = (
    date time subject group session blocknum blockcode trialnum trialcode stimulusitem stimulusitem stimulusitem stimulusitem
    response responsetext latency correct
    values.sceneItemnumber values.scenePairedFaceItemnumber values.scenePairmateFaceItemnumber values.sceneUnrelatedFaceItemnumber
    values.scenePairedFacePositionnumber values.scenePairmateFacePositionnumber values.sceneUnrelatedFacePositionnumber
    )
</data>


Thank you so much. I apologize for not providing the additional information you asked for in time. I appreciate you sending this code anyway. It works great except that in the study phase it is only ever picking Face 1. On each trial the scene-face pairing should be unique. 

Thanks again for any help.

> in the study phase it is only ever picking Face 1

You can be sure I tested the code and it is not doing that. Attached a data file resulting from running the exact code as posted.

Attachments
lir1995
lir1995
Partner Member (831 reputation)Partner Member (831 reputation)Partner Member (831 reputation)Partner Member (831 reputation)Partner Member (831 reputation)Partner Member (831 reputation)Partner Member (831 reputation)Partner Member (831 reputation)Partner Member (831 reputation)
Group: Forum Members
Posts: 44, Visits: 201
Dave - 11/22/2024
lir1995 - 11/22/2024
Dave - 11/22/2024
Dave - 11/21/2024
lir1995 - 11/21/2024
Hello, 

I have an experiment where participants study faces and scenes, and will then be tested on their memory for the face scene pairings (study1-test1-study2-test2). I was able to get the study part working, where faces and scenes are initially randomly paired together during study1. During study2 the same scene-face pairings are presented again. 

However, we are having trouble with the test portion. For the study portion, the face and scene are presented next to each other (horizontal). However, for the test portion, One scene is presented in the top middle of the screen with three faces underneath.  In the test , we need the correct face to be presented with the correct scene, in addition to two additional faces. Here are two issues we are facing: 

1. The way we have it coded now, the pairings are saved with the scenes and faces in a specific, horizontal position. How do we show the same scene-face pairing from the study phase (horizontal) in the test phase with the scene on top of the face?

2. Ideally, the face choices would be the face initially paired with the scene, one random face, and one that was paired with a pairmate of the correct answer scene (arcade 1 and arcade 2). Right now we just have all of the scenes listed out in one item element and not grouped together by pairmates. Though they are ordered by pairmates (e.g., 1 & 2 go together, 3 & 4 together, etc.).  Is it possibly to have the test phase have The scene on top, and then three faces on the bottom that include: faces from the correct scene, its pairmate, and then a random face? If this is not possible, we need it so the other two faces are random and not the same as each other. 

Here is the code we have so far with a working study phase and in progress test phase. Any help is very much appreciated. Thank you for your time.

**************
STIMULI
**************
************
Import Faces
************
<item Face>
  / 1 = "Faces/1.jpg"
  / 2 = "Faces/2.jpg"
  / 3 = "Faces/3.jpg"
  / 4 = "Faces/4.jpg"
  / 5 = "Faces/5.jpg"
  / 6 = "Faces/6.jpg"
  / 7 = "Faces/7.jpg"
  / 8 = "Faces/8.jpg"
  / 9 = "Faces/9.jpg"
  / 10 = "Faces/10.jpg"
</item>
******
Values
******
<values>
/ Facevalue = 1
/ everythingvalue = 1
</values>
# used for randomization
****
List
****
<list randomface>
/ poolsize = 10
</list>
<list randomscene>
/ poolsize = 10
</list>
<list repeatface>
</list>
<list repeatscene>
/ selectionmode = list.repeatface.currentindex
</list>
*************
Locate Scenes
*************
<item everything>
/1 = "scene_files_test/Scenes/Arcade 1.jpg"
/2 = "scene_files_test/Scenes/Arcade 2.jpg"
/3 = "scene_files_test/Scenes/Auditorium 1.jpg"
/4 = "scene_files_test/Scenes/Auditorium 2.jpg"
/5 = "scene_files_test/Scenes/Bridge 1.jpg"
/6 = "scene_files_test/Scenes/Bridge 2.jpg"
/7 = "scene_files_test/Scenes/Dock 1.jpg"
/8 = "scene_files_test/Scenes/Dock 2.jpg"
/9 = "scene_files_test/Scenes/Hallway 1.jpg"
/10 = "scene_files_test/Scenes/Hallway 2.jpg"
</item>
****************
Picture Elements
****************
#STUDY PHASE

<picture face_pictured_2>
/ items = Face
/ position = (27%, 50%)
/ size = (50%, 50%)
/ select = values.Facevalue
</picture>

<picture scene1_display>
/ items = everything
/ position = (70%, 50%)
/ size = (50%, 50%)
/ select = values.everythingvalue
</picture>
#for the scenes in the first part


##TEST PHASE

<picture face_pictured_3>
/ items = Face
/ position = (20%, 80%)
/ size = (30%, 30%)
</picture>
# one face above and three scenes below (second part)

<picture face_pictured_4>
/ items = Face
/ position = (50%, 80%)
/ size = (30%, 30%)
</picture>
# one face above and three scenes below (second part)

<picture face_pictured_5>
/ items = Face
/ position = (80%, 80%)
/ size = (30%, 30%)
</picture>
# one face above and three scenes below (second part)


<picture scene2_display>
  / items = everything
  / position = (50%, 30%)
  / size = (50%, 50%)
</picture>
#for the scenes in the second part


<shape blank>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
/ erase = false
</shape>

***************
Creating Trials
***************
##STUDY PHASES
<trial Face_and_Scene_show>
/ ontrialbegin = [values.Facevalue=list.randomface.nextindex; values.everythingvalue=list.randomscene.nextindex;
  list.repeatface.appenditem(values.Facevalue); list.repeatscene.appenditem(values.everythingvalue); ]
  / stimulustimes = [
   0 = face_pictured_2;
   0 = scene1_display;
   3000 = blank;
  ]
  / timeout = 4000
  / validresponse = ("1", "2", "3")
  / inputdevice = keyboard
</trial>

<trial Face_and_Scene_repeat>
/ ontrialbegin = [values.Facevalue=list.repeatface.nextvalue; values.everythingvalue=list.repeatscene.nextvalue; ]
  / stimulustimes = [
   0 = face_pictured_2;
   0 = scene1_display;
   3000 = blank;
  ]
  / timeout = 4000
  / validresponse = ("1", "2", "3")
  / inputdevice = keyboard
</trial>
# one face and one scene next to each other (second part)

#TEST PHASE
<trial Face_and_Three_Scenes>
  / stimulustimes = [
   0 = scene2_display;
   0 = face_pictured_3;
   0 = face_pictured_4;
   0 = face_pictured_5;
  ]
  / timeout = 5000
  / validresponse = ("1", "2", "3")
  / inputdevice = keyboard
</trial>
# one face above and three scenes below (third part)
***************
Creating Blocks
***************
<block Show>
/ trials = [1-10 = Face_and_Scene_show]
</block>
# indicates the from Face1, we want four images to be shown (1-4) -> if there aren't four images listed, the code will alternate between the listed ones (ex. switch between one, two, one, two)
# the images are shown in a random order

<block Response>
/ trials = [1-10 = Face_and_Three_Scenes]
</block>

<block Repeat>
/ trials = [1-10 = Face_and_Scene_repeat]
</block>
***********
Experiment
***********
<expt>
/ blocks = [1 = Show; 2 = Response; 3 = Repeat; 4 = Response]
</expt>



(1) Please comment your code: Meaningful explanations of what each part is supposed to do.
(2) If your code requires external files to run (images, etc.) always provide those files along with it.
(3) In your questions, refer to any and all elements as they are named in the code. Otherwise it is difficult to discern what you are referring to.

Here's how I would set this up, so far as I can make sense of your description. You didn't provide the images, so I had to resort to using <text> elements as placeholders.

<expt a>
/ onexptbegin = [
    // set up the scene-face-pairings
    var i = 1;
    while (i < 11) {
        var currentFace = list.faceItemnumbers.nextindex; // pick a face at random
        list.scenePairedFaceItemnumbers.setitem(currentFace, i); // pair it with scene i
        if (mod(i, 2) == 1) { // if i is odd
            list.scenePairmateFaceItemnumbers.setitem(currentFace, i+1); // the face is the pairmate for scene i+1
        } else { // otherwise
            list.scenePairmateFaceItemnumbers.setitem(currentFace, i-1); // the face is the pairmate for scene i-1
        };
        i += 1;
    };
]
/ blocks = [1-2 = sequence(study, test)] // study -> test -> study -> test
</expt>

<values>
/ sceneItemnumber = 0 // item number of current scene
/ scenePairedFaceItemnumber = 0 // item number scene-paired face
/ scenePairmateFaceItemnumber = 0 // item number of pairmate-paired face
/ sceneUnrelatedFaceItemnumber = 0 // item number of unrlated face (not scene- or pairmate-paired)

/ scenePairedFacePositionnumber = 0 // in which position the scene-paired face is located
/ scenePairmateFacePositionnumber = 0 // in which position the pairmate-paired face is located
/ sceneUnrelatedFacePositionnumber = 0 // in which position the scene-unrelated face is located
</values>

// study phase
<block study>
/ trials = [1-10 = studyTrial] // 10 trials
</block>

<trial studyTrial>
/ ontrialbegin = [
    values.sceneItemnumber = list.sceneItemNumbers.nextvalue; // pick scene to study
    values.scenePairedFaceItemnumber = list.scenePairedFaceItemnumbers.nextvalue; // pick face paired to scene
]
/ stimulustimes = [0=studyScene, studyFace; 3000=clearscreen]
/ trialduration = 4000
/ validresponse = (0)
</trial>

<text studyFace>
/ items = faceItems
/ position = (27%, 50%)
/ select = values.scenePairedFaceItemnumber
</text>

<text studyScene>
/ items = sceneItems
/ position = (70%, 50%)
/ select = values.sceneItemnumber
</text>

// test phase
<block test>
/ trials = [1-10 = testTrial] // 10 trials
</block>

<trial testTrial>
/ ontrialbegin = [
    // pick scene to test and associated faces
    values.sceneItemnumber = list.sceneItemNumbers.nextvalue; // pick scene to test
    values.scenePairedFaceItemnumber = list.scenePairedFaceItemnumbers.nextvalue; // pick face paired to scene
    values.scenePairmateFaceItemnumber = list.scenePairmateFaceItemnumbers.nextvalue; // pick face paired to its pairmate scene
    values.sceneUnrelatedFaceItemnumber = list.sceneUnrelatedFaceItemnumbers.nextvalue; // pick a unrelated face out of the remaining (not current scene-paired or pairmate-paired)
    // randomize horizontal position of scene-paired face, pairmate-paired face, and unrelated random face
    values.scenePairedFacePositionnumber = list.testFacePositionNumbers.nextvalue;
    text.testScenePairedFace.hposition = list.positions.item(values.scenePairedFacePositionnumber);
    values.scenePairmateFacePositionnumber = list.testFacePositionNumbers.nextvalue;
    text.testScenePairmateFace.hposition = list.positions.item(values.scenePairmateFacePositionnumber);
    values.sceneUnrelatedFacePositionnumber = list.testFacePositionNumbers.nextvalue;
    text.testSceneUnrelatedFace.hposition = list.positions.item(values.sceneUnrelatedFacePositionnumber);
    ]
/ stimulustimes = [0=testScene, testScenePairedFace, testScenePairmateFace, testSceneUnrelatedFace]
/ validresponse = ("1", "2", "3")
/ iscorrectresponse = [
    trial.testTrial.responsetext == values.scenePairedFacePositionNumber; // correct if position of scene-paired face identified
]
/ timeout = 5000
</trial>

<text testScene>
/ items = sceneItems
/ position = (50%, 10%)
/ select = values.sceneItemnumber
</text>

<text testScenePairedFace>
/ items = faceItems
/ select = values.scenePairedFaceItemnumber
/ vposition = 80%
</text>

<text testScenePairmateFace>
/ items = faceItems
/ select = values.scenePairmateFaceItemnumber
/ vposition = 80%
</text>

<text testSceneUnrelatedFace>
/ items = faceItems
/ select = values.sceneUnrelatedFaceItemnumber
/ vposition = 80%
</text>

<item faceItems>
/ 1 = "Faces/1.jpg"
/ 2 = "Faces/2.jpg"
/ 3 = "Faces/3.jpg"
/ 4 = "Faces/4.jpg"
/ 5 = "Faces/5.jpg"
/ 6 = "Faces/6.jpg"
/ 7 = "Faces/7.jpg"
/ 8 = "Faces/8.jpg"
/ 9 = "Faces/9.jpg"
/ 10 = "Faces/10.jpg"
</item>

<item sceneItems>
/1 = "scene_files_test/Scenes/Arcade 1.jpg"
/2 = "scene_files_test/Scenes/Arcade 2.jpg"
/3 = "scene_files_test/Scenes/Auditorium 1.jpg"
/4 = "scene_files_test/Scenes/Auditorium 2.jpg"
/5 = "scene_files_test/Scenes/Bridge 1.jpg"
/6 = "scene_files_test/Scenes/Bridge 2.jpg"
/7 = "scene_files_test/Scenes/Dock 1.jpg"
/8 = "scene_files_test/Scenes/Dock 2.jpg"
/9 = "scene_files_test/Scenes/Hallway 1.jpg"
/10 = "scene_files_test/Scenes/Hallway 2.jpg"
</item>

<list faceItemnumbers>
/ poolsize = 10
/ selectionrate = always
</list>

<list sceneItemNumbers>
/ items = (1,2,3,4,5,6,7,8,9,10)
</list>

<list scenePairedFaceItemnumbers>
/ items = (0,0,0,0,0,0,0,0,0,0) // set onextbegin
/ selectionmode = list.sceneItemNumbers.currentindex
</list>

<list scenePairmateFaceItemnumbers>
/ items = (0,0,0,0,0,0,0,0,0,0) // set onexptbegin
/ selectionmode = list.sceneItemNumbers.currentindex
</list>

<list sceneUnrelatedFaceItemnumbers>
/ items = (1,2,3,4,5,6,7,8,9,10)
/ not = (values.scenePairedFaceItemnumber)
/ not = (values.scenePairmateFaceItemnumber)
/ selectionrate = always
</list>

<list testFacePositionNumbers>
/ items = (1,2,3)
/ selectionrate = always
</list>

<list positions>
/ items = (20%, 50%, 80%)
</list>

<data>
/ columns = (
    date time subject group session blocknum blockcode trialnum trialcode stimulusitem stimulusitem stimulusitem stimulusitem
    response responsetext latency correct
    values.sceneItemnumber values.scenePairedFaceItemnumber values.scenePairmateFaceItemnumber values.sceneUnrelatedFaceItemnumber
    values.scenePairedFacePositionnumber values.scenePairmateFacePositionnumber values.sceneUnrelatedFacePositionnumber
    )
</data>


Thank you so much. I apologize for not providing the additional information you asked for in time. I appreciate you sending this code anyway. It works great except that in the study phase it is only ever picking Face 1. On each trial the scene-face pairing should be unique. 

Thanks again for any help.

> in the study phase it is only ever picking Face 1

You can be sure I tested the code and it is not doing that. Attached a data file resulting from running the exact code as posted.

Thank you so much!
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: 13K, Visits: 104K
lir1995 - 11/22/2024
Dave - 11/22/2024
lir1995 - 11/22/2024
Dave - 11/22/2024
Dave - 11/21/2024
lir1995 - 11/21/2024
Hello, 

I have an experiment where participants study faces and scenes, and will then be tested on their memory for the face scene pairings (study1-test1-study2-test2). I was able to get the study part working, where faces and scenes are initially randomly paired together during study1. During study2 the same scene-face pairings are presented again. 

However, we are having trouble with the test portion. For the study portion, the face and scene are presented next to each other (horizontal). However, for the test portion, One scene is presented in the top middle of the screen with three faces underneath.  In the test , we need the correct face to be presented with the correct scene, in addition to two additional faces. Here are two issues we are facing: 

1. The way we have it coded now, the pairings are saved with the scenes and faces in a specific, horizontal position. How do we show the same scene-face pairing from the study phase (horizontal) in the test phase with the scene on top of the face?

2. Ideally, the face choices would be the face initially paired with the scene, one random face, and one that was paired with a pairmate of the correct answer scene (arcade 1 and arcade 2). Right now we just have all of the scenes listed out in one item element and not grouped together by pairmates. Though they are ordered by pairmates (e.g., 1 & 2 go together, 3 & 4 together, etc.).  Is it possibly to have the test phase have The scene on top, and then three faces on the bottom that include: faces from the correct scene, its pairmate, and then a random face? If this is not possible, we need it so the other two faces are random and not the same as each other. 

Here is the code we have so far with a working study phase and in progress test phase. Any help is very much appreciated. Thank you for your time.

**************
STIMULI
**************
************
Import Faces
************
<item Face>
  / 1 = "Faces/1.jpg"
  / 2 = "Faces/2.jpg"
  / 3 = "Faces/3.jpg"
  / 4 = "Faces/4.jpg"
  / 5 = "Faces/5.jpg"
  / 6 = "Faces/6.jpg"
  / 7 = "Faces/7.jpg"
  / 8 = "Faces/8.jpg"
  / 9 = "Faces/9.jpg"
  / 10 = "Faces/10.jpg"
</item>
******
Values
******
<values>
/ Facevalue = 1
/ everythingvalue = 1
</values>
# used for randomization
****
List
****
<list randomface>
/ poolsize = 10
</list>
<list randomscene>
/ poolsize = 10
</list>
<list repeatface>
</list>
<list repeatscene>
/ selectionmode = list.repeatface.currentindex
</list>
*************
Locate Scenes
*************
<item everything>
/1 = "scene_files_test/Scenes/Arcade 1.jpg"
/2 = "scene_files_test/Scenes/Arcade 2.jpg"
/3 = "scene_files_test/Scenes/Auditorium 1.jpg"
/4 = "scene_files_test/Scenes/Auditorium 2.jpg"
/5 = "scene_files_test/Scenes/Bridge 1.jpg"
/6 = "scene_files_test/Scenes/Bridge 2.jpg"
/7 = "scene_files_test/Scenes/Dock 1.jpg"
/8 = "scene_files_test/Scenes/Dock 2.jpg"
/9 = "scene_files_test/Scenes/Hallway 1.jpg"
/10 = "scene_files_test/Scenes/Hallway 2.jpg"
</item>
****************
Picture Elements
****************
#STUDY PHASE

<picture face_pictured_2>
/ items = Face
/ position = (27%, 50%)
/ size = (50%, 50%)
/ select = values.Facevalue
</picture>

<picture scene1_display>
/ items = everything
/ position = (70%, 50%)
/ size = (50%, 50%)
/ select = values.everythingvalue
</picture>
#for the scenes in the first part


##TEST PHASE

<picture face_pictured_3>
/ items = Face
/ position = (20%, 80%)
/ size = (30%, 30%)
</picture>
# one face above and three scenes below (second part)

<picture face_pictured_4>
/ items = Face
/ position = (50%, 80%)
/ size = (30%, 30%)
</picture>
# one face above and three scenes below (second part)

<picture face_pictured_5>
/ items = Face
/ position = (80%, 80%)
/ size = (30%, 30%)
</picture>
# one face above and three scenes below (second part)


<picture scene2_display>
  / items = everything
  / position = (50%, 30%)
  / size = (50%, 50%)
</picture>
#for the scenes in the second part


<shape blank>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
/ erase = false
</shape>

***************
Creating Trials
***************
##STUDY PHASES
<trial Face_and_Scene_show>
/ ontrialbegin = [values.Facevalue=list.randomface.nextindex; values.everythingvalue=list.randomscene.nextindex;
  list.repeatface.appenditem(values.Facevalue); list.repeatscene.appenditem(values.everythingvalue); ]
  / stimulustimes = [
   0 = face_pictured_2;
   0 = scene1_display;
   3000 = blank;
  ]
  / timeout = 4000
  / validresponse = ("1", "2", "3")
  / inputdevice = keyboard
</trial>

<trial Face_and_Scene_repeat>
/ ontrialbegin = [values.Facevalue=list.repeatface.nextvalue; values.everythingvalue=list.repeatscene.nextvalue; ]
  / stimulustimes = [
   0 = face_pictured_2;
   0 = scene1_display;
   3000 = blank;
  ]
  / timeout = 4000
  / validresponse = ("1", "2", "3")
  / inputdevice = keyboard
</trial>
# one face and one scene next to each other (second part)

#TEST PHASE
<trial Face_and_Three_Scenes>
  / stimulustimes = [
   0 = scene2_display;
   0 = face_pictured_3;
   0 = face_pictured_4;
   0 = face_pictured_5;
  ]
  / timeout = 5000
  / validresponse = ("1", "2", "3")
  / inputdevice = keyboard
</trial>
# one face above and three scenes below (third part)
***************
Creating Blocks
***************
<block Show>
/ trials = [1-10 = Face_and_Scene_show]
</block>
# indicates the from Face1, we want four images to be shown (1-4) -> if there aren't four images listed, the code will alternate between the listed ones (ex. switch between one, two, one, two)
# the images are shown in a random order

<block Response>
/ trials = [1-10 = Face_and_Three_Scenes]
</block>

<block Repeat>
/ trials = [1-10 = Face_and_Scene_repeat]
</block>
***********
Experiment
***********
<expt>
/ blocks = [1 = Show; 2 = Response; 3 = Repeat; 4 = Response]
</expt>



(1) Please comment your code: Meaningful explanations of what each part is supposed to do.
(2) If your code requires external files to run (images, etc.) always provide those files along with it.
(3) In your questions, refer to any and all elements as they are named in the code. Otherwise it is difficult to discern what you are referring to.

Here's how I would set this up, so far as I can make sense of your description. You didn't provide the images, so I had to resort to using <text> elements as placeholders.

<expt a>
/ onexptbegin = [
    // set up the scene-face-pairings
    var i = 1;
    while (i < 11) {
        var currentFace = list.faceItemnumbers.nextindex; // pick a face at random
        list.scenePairedFaceItemnumbers.setitem(currentFace, i); // pair it with scene i
        if (mod(i, 2) == 1) { // if i is odd
            list.scenePairmateFaceItemnumbers.setitem(currentFace, i+1); // the face is the pairmate for scene i+1
        } else { // otherwise
            list.scenePairmateFaceItemnumbers.setitem(currentFace, i-1); // the face is the pairmate for scene i-1
        };
        i += 1;
    };
]
/ blocks = [1-2 = sequence(study, test)] // study -> test -> study -> test
</expt>

<values>
/ sceneItemnumber = 0 // item number of current scene
/ scenePairedFaceItemnumber = 0 // item number scene-paired face
/ scenePairmateFaceItemnumber = 0 // item number of pairmate-paired face
/ sceneUnrelatedFaceItemnumber = 0 // item number of unrlated face (not scene- or pairmate-paired)

/ scenePairedFacePositionnumber = 0 // in which position the scene-paired face is located
/ scenePairmateFacePositionnumber = 0 // in which position the pairmate-paired face is located
/ sceneUnrelatedFacePositionnumber = 0 // in which position the scene-unrelated face is located
</values>

// study phase
<block study>
/ trials = [1-10 = studyTrial] // 10 trials
</block>

<trial studyTrial>
/ ontrialbegin = [
    values.sceneItemnumber = list.sceneItemNumbers.nextvalue; // pick scene to study
    values.scenePairedFaceItemnumber = list.scenePairedFaceItemnumbers.nextvalue; // pick face paired to scene
]
/ stimulustimes = [0=studyScene, studyFace; 3000=clearscreen]
/ trialduration = 4000
/ validresponse = (0)
</trial>

<text studyFace>
/ items = faceItems
/ position = (27%, 50%)
/ select = values.scenePairedFaceItemnumber
</text>

<text studyScene>
/ items = sceneItems
/ position = (70%, 50%)
/ select = values.sceneItemnumber
</text>

// test phase
<block test>
/ trials = [1-10 = testTrial] // 10 trials
</block>

<trial testTrial>
/ ontrialbegin = [
    // pick scene to test and associated faces
    values.sceneItemnumber = list.sceneItemNumbers.nextvalue; // pick scene to test
    values.scenePairedFaceItemnumber = list.scenePairedFaceItemnumbers.nextvalue; // pick face paired to scene
    values.scenePairmateFaceItemnumber = list.scenePairmateFaceItemnumbers.nextvalue; // pick face paired to its pairmate scene
    values.sceneUnrelatedFaceItemnumber = list.sceneUnrelatedFaceItemnumbers.nextvalue; // pick a unrelated face out of the remaining (not current scene-paired or pairmate-paired)
    // randomize horizontal position of scene-paired face, pairmate-paired face, and unrelated random face
    values.scenePairedFacePositionnumber = list.testFacePositionNumbers.nextvalue;
    text.testScenePairedFace.hposition = list.positions.item(values.scenePairedFacePositionnumber);
    values.scenePairmateFacePositionnumber = list.testFacePositionNumbers.nextvalue;
    text.testScenePairmateFace.hposition = list.positions.item(values.scenePairmateFacePositionnumber);
    values.sceneUnrelatedFacePositionnumber = list.testFacePositionNumbers.nextvalue;
    text.testSceneUnrelatedFace.hposition = list.positions.item(values.sceneUnrelatedFacePositionnumber);
    ]
/ stimulustimes = [0=testScene, testScenePairedFace, testScenePairmateFace, testSceneUnrelatedFace]
/ validresponse = ("1", "2", "3")
/ iscorrectresponse = [
    trial.testTrial.responsetext == values.scenePairedFacePositionNumber; // correct if position of scene-paired face identified
]
/ timeout = 5000
</trial>

<text testScene>
/ items = sceneItems
/ position = (50%, 10%)
/ select = values.sceneItemnumber
</text>

<text testScenePairedFace>
/ items = faceItems
/ select = values.scenePairedFaceItemnumber
/ vposition = 80%
</text>

<text testScenePairmateFace>
/ items = faceItems
/ select = values.scenePairmateFaceItemnumber
/ vposition = 80%
</text>

<text testSceneUnrelatedFace>
/ items = faceItems
/ select = values.sceneUnrelatedFaceItemnumber
/ vposition = 80%
</text>

<item faceItems>
/ 1 = "Faces/1.jpg"
/ 2 = "Faces/2.jpg"
/ 3 = "Faces/3.jpg"
/ 4 = "Faces/4.jpg"
/ 5 = "Faces/5.jpg"
/ 6 = "Faces/6.jpg"
/ 7 = "Faces/7.jpg"
/ 8 = "Faces/8.jpg"
/ 9 = "Faces/9.jpg"
/ 10 = "Faces/10.jpg"
</item>

<item sceneItems>
/1 = "scene_files_test/Scenes/Arcade 1.jpg"
/2 = "scene_files_test/Scenes/Arcade 2.jpg"
/3 = "scene_files_test/Scenes/Auditorium 1.jpg"
/4 = "scene_files_test/Scenes/Auditorium 2.jpg"
/5 = "scene_files_test/Scenes/Bridge 1.jpg"
/6 = "scene_files_test/Scenes/Bridge 2.jpg"
/7 = "scene_files_test/Scenes/Dock 1.jpg"
/8 = "scene_files_test/Scenes/Dock 2.jpg"
/9 = "scene_files_test/Scenes/Hallway 1.jpg"
/10 = "scene_files_test/Scenes/Hallway 2.jpg"
</item>

<list faceItemnumbers>
/ poolsize = 10
/ selectionrate = always
</list>

<list sceneItemNumbers>
/ items = (1,2,3,4,5,6,7,8,9,10)
</list>

<list scenePairedFaceItemnumbers>
/ items = (0,0,0,0,0,0,0,0,0,0) // set onextbegin
/ selectionmode = list.sceneItemNumbers.currentindex
</list>

<list scenePairmateFaceItemnumbers>
/ items = (0,0,0,0,0,0,0,0,0,0) // set onexptbegin
/ selectionmode = list.sceneItemNumbers.currentindex
</list>

<list sceneUnrelatedFaceItemnumbers>
/ items = (1,2,3,4,5,6,7,8,9,10)
/ not = (values.scenePairedFaceItemnumber)
/ not = (values.scenePairmateFaceItemnumber)
/ selectionrate = always
</list>

<list testFacePositionNumbers>
/ items = (1,2,3)
/ selectionrate = always
</list>

<list positions>
/ items = (20%, 50%, 80%)
</list>

<data>
/ columns = (
    date time subject group session blocknum blockcode trialnum trialcode stimulusitem stimulusitem stimulusitem stimulusitem
    response responsetext latency correct
    values.sceneItemnumber values.scenePairedFaceItemnumber values.scenePairmateFaceItemnumber values.sceneUnrelatedFaceItemnumber
    values.scenePairedFacePositionnumber values.scenePairmateFacePositionnumber values.sceneUnrelatedFacePositionnumber
    )
</data>


Thank you so much. I apologize for not providing the additional information you asked for in time. I appreciate you sending this code anyway. It works great except that in the study phase it is only ever picking Face 1. On each trial the scene-face pairing should be unique. 

Thanks again for any help.

> in the study phase it is only ever picking Face 1

You can be sure I tested the code and it is not doing that. Attached a data file resulting from running the exact code as posted.

Thank you so much!

Here's the original script file as well.
Attachments
forumcode.iqx (23 views, 5.00 KB)
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search