Millisecond Forums

Ensuring that primes are equally paired with targets from two categories

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

By andrew.dorsey - 1/27/2020

Hello,

I am attempting to adapt a script from the Millisecond Test Library. I am specifically trying to adapt the Affective Priming Procedure. 

In the test library, the script uses 24 pleasant primes and 24 unpleasant primes that also serve as the targets in the task. Here is the code:

**************************************************************************************************************
**************************************************************************************************************
    EDITABLE STIMULI: change editable stimuli here
**************************************************************************************************************
**************************************************************************************************************

<item UnpleasantPrimes>
/1 = "EVIL"
/2 = "CANCER"
/3 = "SICKNESS"
/4 = "DISASTER"
/5 = "POVERTY"
/6 = "VOMIT"
/7 = "BOMB"
/8 = "ROTTEN"
/9 = "ABUSE"
/10 = "MURDER"
/11 = "ASSAULT"
/12 = "SLIME"
/13 = "DIVORCE"
/14 = "POISON"
/15 = "KILL"
/16 = "DEATH"
/17 = "HATRED"
/18 = "SCUM"
/19 = "ACCIDENT"
/20 = "JAIL"
/21 = "STINK"
/22 = "TORTURE"
/23 = "CRASH"
/24 = "FILTH"
</item>

<item PleasantPrimes>
/1 = "HONOR"
/2 = "LUCKY"
/3 = "DIAMOND"
/4 = "LOYAL"
/5 = "FREEDOM"
/6 = "RAINBOW"
/7 = "LOVE"
/8 = "HONEST"
/9 = "PEACE"
/10 = "HEAVEN"
/11 = "PLEASURE"
/12 = "FAMILY"
/13 = "DIPLOMA"
/14 = "KISS"
/15 = "CHEER"
/16 = "HEALTH"
/17 = "FRIEND"
/18 = "CARESS"
/19 = "SUNSET"
/20 = "HAPPY"
/21 = "MIRACLE"
/22 = "SUNRISE"
/23 = "PARADISE"
/24 = "VACATION"
</item>

<item UnpleasantTargets>
/1 = "EVIL"
/2 = "CANCER"
/3 = "SICKNESS"
/4 = "DISASTER"
/5 = "POVERTY"
/6 = "VOMIT"
/7 = "BOMB"
/8 = "ROTTEN"
/9 = "ABUSE"
/10 = "MURDER"
/11 = "ASSAULT"
/12 = "SLIME"
/13 = "DIVORCE"
/14 = "POISON"
/15 = "KILL"
/16 = "DEATH"
/17 = "HATRED"
/18 = "SCUM"
/19 = "ACCIDENT"
/20 = "JAIL"
/21 = "STINK"
/22 = "TORTURE"
/23 = "CRASH"
/24 = "FILTH"
</item>

<item PleasantTargets>
/1 = "HONOR"
/2 = "LUCKY"
/3 = "DIAMOND"
/4 = "LOYAL"
/5 = "FREEDOM"
/6 = "RAINBOW"
/7 = "LOVE"
/8 = "HONEST"
/9 = "PEACE"
/10 = "HEAVEN"
/11 = "PLEASURE"
/12 = "FAMILY"
/13 = "DIPLOMA"
/14 = "KISS"
/15 = "CHEER"
/16 = "HEALTH"
/17 = "FRIEND"
/18 = "CARESS"
/19 = "SUNSET"
/20 = "HAPPY"
/21 = "MIRACLE"
/22 = "SUNRISE"
/23 = "PARADISE"
/24 = "VACATION"
</item>


What I'm trying to adapt in my script is that I'd like to have (a) a smaller number of primes that don't serve as target words and (b) for primes to be paired equally with positive and negative valence targets. Here's how I tried to adapt this code to achieve this result (I just repeated a smaller number of primes over and over in a list):

**************************************************************************************************************
**************************************************************************************************************
    EDITABLE STIMULI: change editable stimuli here
**************************************************************************************************************
**************************************************************************************************************

<item UnpleasantPrimes>
/1 = "MURDER"
/2 = "KILL"
/3 = "FAULT"
/4 = "LATE"
/5 = "MURDER"
/6 = "KILL"
/7 = "FAULT"
/8 = "LATE"
/9 = "MURDER"
/10 = "KILL"
/11 = "FAULT"
/12 = "LATE"
/13 = "MURDER"
/14 = "KILL"
/15 = "FAULT"
/16 = "LATE"
/17 = "MURDER"
/18 = "KILL"
/19 = "FAULT"
/20 = "LATE"
/21 = "MURDER"
/22 = "KILL"
/23 = "FAULT"
/24 = "LATE"
</item>

<item PleasantPrimes>
/1 = "HAPPY"
/2 = "LOVE"
/3 = "NICE"
/4 = "LUNCH"
/5 = "HAPPY"
/6 = "LOVE"
/7 = "NICE"
/8 = "LUNCH"
/9 = "HAPPY"
/10 = "LOVE"
/11 = "NICE"
/12 = "LUNCH"
/13 = "HAPPY"
/14 = "LOVE"
/15 = "NICE"
/16 = "LUNCH"
/17 = "HAPPY"
/18 = "LOVE"
/19 = "NICE"
/20 = "LUNCH"
/21 = "HAPPY"
/22 = "LOVE"
/23 = "NICE"
/24 = "LUNCH"
</item>

<item UnpleasantTargets>
/1 = "EVIL"
/2 = "FORGET"
/3 = "STUPID"
/4 = "WORRY"
/5 = "POVERTY"
/6 = "VOMIT"
/7 = "IDIOT"
/8 = "ROTTEN"
/9 = "HEADACHE"
/10 = "LOUSY"
/11 = "DEVIL"
/12 = "SLIME"
/13 = "DIVORCE"
/14 = "FAILURE"
/15 = "FRAUD"
/16 = "TERRIBLE"
/17 = "POLLUTE"
/18 = "SCUM"
/19 = "UGLY"
/20 = "HUMILIATE"
/21 = "STINK"
/22 = "WASTE"
/23 = "SNOB"
/24 = "FILTH"
</item>

<item PleasantTargets>
/1 = "SWEET"
/2 = "LUCKY"
/3 = "THANKFUL"
/4 = "PRETTY"
/5 = "FREEDOM"
/6 = "RAINBOW"
/7 = "GREAT"
/8 = "HONEST"
/9 = "PEACE"
/10 = "HEAVEN"
/11 = "PLEASURE"
/12 = "EASY"
/13 = "TRUTH"
/14 = "FRIEND"
/15 = "CHEER"
/16 = "HOPE"
/17 = "WONDERFUL"
/18 = "HUMOR"
/19 = "SUNSET"
/20 = "TERRIFIC"
/21 = "MIRACLE"
/22 = "SUNRISE"
/23 = "PARADISE"
/24 = "VACATION"
</item>


This strategy didn't work because a prime like "MURDER" isn't always equally paired with positive and negative targets. Theoretically, it should be paired with positive targets 3 times and negative targets 3 times during the test block of the experiment. 

Can anyone help me adapt this script to make sure that primes are paired with positive and negative targets equally often?

Andrew



By Dave - 1/27/2020


You need to set up separate <list> elements for each trial type and then sample from those accordingly. That is

**************************************************************************************************************
**************************************************************************************************************
    EDITABLE STIMULI: change editable stimuli here
**************************************************************************************************************
**************************************************************************************************************

<item UnpleasantPrimes>
/1 = "MURDER"
/2 = "KILL"
/3 = "FAULT"
/4 = "LATE"
</item>

<item PleasantPrimes>
/1 = "HAPPY"
/2 = "LOVE"
/3 = "NICE"
/4 = "LUNCH"
</item>

<item UnpleasantTargets>
/1 = "EVIL"
/2 = "FORGET"
/3 = "STUPID"
/4 = "WORRY"
/5 = "POVERTY"
/6 = "VOMIT"
/7 = "IDIOT"
/8 = "ROTTEN"
/9 = "HEADACHE"
/10 = "LOUSY"
/11 = "DEVIL"
/12 = "SLIME"
/13 = "DIVORCE"
/14 = "FAILURE"
/15 = "FRAUD"
/16 = "TERRIBLE"
/17 = "POLLUTE"
/18 = "SCUM"
/19 = "UGLY"
/20 = "HUMILIATE"
/21 = "STINK"
/22 = "WASTE"
/23 = "SNOB"
/24 = "FILTH"
</item>

<item PleasantTargets>
/1 = "SWEET"
/2 = "LUCKY"
/3 = "THANKFUL"
/4 = "PRETTY"
/5 = "FREEDOM"
/6 = "RAINBOW"
/7 = "GREAT"
/8 = "HONEST"
/9 = "PEACE"
/10 = "HEAVEN"
/11 = "PLEASURE"
/12 = "EASY"
/13 = "TRUTH"
/14 = "FRIEND"
/15 = "CHEER"
/16 = "HOPE"
/17 = "WONDERFUL"
/18 = "HUMOR"
/19 = "SUNSET"
/20 = "TERRIFIC"
/21 = "MIRACLE"
/22 = "SUNRISE"
/23 = "PARADISE"
/24 = "VACATION"
</item>

with

<list UP_UnpleasantPrimeitemnumbers>
/ items = (1, 2, 3, 4)
/ poolsize = 12
/ replace = false
/ resetinterval = 1
</list>

<list UU_UnpleasantPrimeitemnumbers>
/ items = (1, 2, 3, 4)
/ poolsize = 12
/ replace = false
/ resetinterval = 1
</list>

<list PP_PleasantPrimeitemnumbers>
/ items = (1, 2, 3, 4)
/ poolsize = 12
/ replace = false
/ resetinterval = 1
</list>

<list PU_PleasantPrimeitemnumbers>
/ items = (1, 2, 3, 4)
/ poolsize = 12
/ replace = false
/ resetinterval = 1
</list>

and

<trial UU_test>
/ ontrialbegin = [values.counttrials_test += 1; values.UU_test += 1]
/ ontrialbegin = [values.primecategory="Unpleasant"; values.targetcategory="Unpleasant"]

/ ontrialbegin = [values.targetitemnumber = list.UnpleasantTargetitemnumbers.nextvalue; values.primeitemnumber = list.UU_UnpleasantPrimeitemnumbers.nextvalue]
/ ontrialbegin = [trial.UU_test.insertstimulustime(shape.eraser, (values.primeduration))]
/ ontrialbegin = [trial.UU_test.insertstimulustime(text.UnpleasantTarget, (values.primeduration + values.pt_isi))]
/ ontrialend = [trial.UU_test.resetstimulusframes()]
/ stimulustimes = [0 = UnpleasantPrime]
/ beginresponsetime = values.primeduration + values.pt_isi
/ responseinterrupt = immediate
/ monkeyresponse = (18, 23)
/ isvalidresponse = [trial.UU_test.response==values.responsekeyUnpleasant || trial.UU_test.response == values.responsekeyPleasant]
/ iscorrectresponse = [trial.UU_test.response == values.responsekeyUnpleasant]

/ ontrialend = [values.prime = text.UnpleasantPrime.currentitem; values.target = text.UnpleasantTarget.currentitem]

/ ontrialend = [if (trial.UU_test.correct) {values.corr_test += 1;
                                                    values.sumRT_test += trial.UU_test.latency;
                                                    values.corr_UU_test += 1;
                                                    values.sumRT_UU_test += trial.UU_test.latency}]
/ posttrialpause = values.iti
/ errormessage = true(errorfeedback, 500)
</trial>

<trial UP_test>
/ ontrialbegin = [values.counttrials_test += 1; values.UP_test += 1]
/ ontrialbegin = [values.primecategory="Unpleasant"; values.targetcategory="Pleasant"]

/ ontrialbegin = [values.targetitemnumber = list.PleasantTargetitemnumbers.nextvalue; values.primeitemnumber = list.UP_UnpleasantPrimeitemnumbers.nextvalue]
/ ontrialbegin = [trial.UP_test.insertstimulustime(shape.eraser, (values.primeduration))]
/ ontrialbegin = [trial.UP_test.insertstimulustime(text.PleasantTarget, (values.primeduration + values.pt_isi))]
/ ontrialend = [trial.UP_test.resetstimulusframes()]
/ stimulustimes = [0 = UnpleasantPrime]
/ beginresponsetime = values.primeduration + values.pt_isi
/ responseinterrupt = immediate
/ monkeyresponse = (18, 23)
/ isvalidresponse = [trial.UP_test.response==values.responsekeyUnpleasant || trial.UP_test.response == values.responsekeyPleasant]
/ iscorrectresponse = [trial.UP_test.response == values.responsekeyPleasant]

/ ontrialend = [values.prime = text.UnpleasantPrime.currentitem; values.target = text.PleasantTarget.currentitem]

/ ontrialend = [if (trial.UP_test.correct) {values.corr_test += 1;
                                                    values.sumRT_test += trial.UP_test.latency;
                                                    values.corr_UP_test += 1;
                                                    values.sumRT_UP_test += trial.UP_test.latency}]
/ posttrialpause = values.iti
/ errormessage = true(errorfeedback, 500)
</trial>

<trial PU_test>
/ ontrialbegin = [values.counttrials_test += 1; values.PU_test += 1]
/ ontrialbegin = [values.primecategory="Pleasant"; values.targetcategory="Unpleasant"]

/ ontrialbegin = [values.targetitemnumber = list.UnpleasantTargetitemnumbers.nextvalue; values.primeitemnumber = list.PU_PleasantPrimeitemnumbers.nextvalue]
/ ontrialbegin = [trial.PU_test.insertstimulustime(shape.eraser, (values.primeduration))]
/ ontrialbegin = [trial.PU_test.insertstimulustime(text.UnpleasantTarget, (values.primeduration + values.pt_isi))]
/ ontrialend = [trial.PU_test.resetstimulusframes()]
/ stimulustimes = [0 = PleasantPrime]
/ beginresponsetime = values.primeduration + values.pt_isi
/ responseinterrupt = immediate
/ monkeyresponse = (18, 23)
/ isvalidresponse = [trial.PU_test.response==values.responsekeyUnpleasant || trial.PU_test.response == values.responsekeyPleasant]
/ iscorrectresponse = [trial.PU_test.response == values.responsekeyUnpleasant]

/ ontrialend = [values.prime = text.PleasantPrime.currentitem; values.target = text.UnpleasantTarget.currentitem]

/ ontrialend = [if (trial.PU_test.correct) {values.corr_test += 1;
                                                    values.sumRT_test += trial.PU_test.latency;
                                                    values.corr_PU_test += 1;
                                                    values.sumRT_PU_test += trial.PU_test.latency}]
/ posttrialpause = values.iti
/ errormessage = true(errorfeedback, 500)
</trial>

<trial PP_test>
/ ontrialbegin = [values.counttrials_test += 1; values.PP_test += 1]
/ ontrialbegin = [values.primecategory="Pleasant"; values.targetcategory="Pleasant"]

/ ontrialbegin = [values.targetitemnumber = list.PleasantTargetitemnumbers.nextvalue; values.primeitemnumber = list.PP_PleasantPrimeitemnumbers.nextvalue]
/ ontrialbegin = [trial.PP_test.insertstimulustime(shape.eraser, (values.primeduration))]
/ ontrialbegin = [trial.PP_test.insertstimulustime(text.PleasantTarget, (values.primeduration + values.pt_isi))]
/ ontrialend = [trial.PP_test.resetstimulusframes()]
/ stimulustimes = [0 = PleasantPrime]
/ beginresponsetime = values.primeduration + values.pt_isi
/ responseinterrupt = immediate
/ monkeyresponse = (18, 23)
/ isvalidresponse = [trial.PP_test.response==values.responsekeyUnpleasant || trial.PP_test.response == values.responsekeyPleasant]
/ iscorrectresponse = [trial.PP_test.response == values.responsekeyPleasant]

/ ontrialend = [values.prime = text.PleasantPrime.currentitem; values.target = text.PleasantTarget.currentitem]

/ ontrialend = [if (trial.PP_test.correct) {values.corr_test += 1;
                                                    values.sumRT_test += trial.PP_test.latency;
                                                    values.corr_PP_test += 1;
                                                    values.sumRT_PP_test += trial.PP_test.latency}]
/ posttrialpause = values.iti
/ errormessage = true(errorfeedback, 500)
</trial>
By andrew.dorsey - 1/27/2020

Dave - 1/27/2020

You need to set up separate <list> elements for each trial type and then sample from those accordingly. That is

**************************************************************************************************************
**************************************************************************************************************
    EDITABLE STIMULI: change editable stimuli here
**************************************************************************************************************
**************************************************************************************************************

<item UnpleasantPrimes>
/1 = "MURDER"
/2 = "KILL"
/3 = "FAULT"
/4 = "LATE"
</item>

<item PleasantPrimes>
/1 = "HAPPY"
/2 = "LOVE"
/3 = "NICE"
/4 = "LUNCH"
</item>

<item UnpleasantTargets>
/1 = "EVIL"
/2 = "FORGET"
/3 = "STUPID"
/4 = "WORRY"
/5 = "POVERTY"
/6 = "VOMIT"
/7 = "IDIOT"
/8 = "ROTTEN"
/9 = "HEADACHE"
/10 = "LOUSY"
/11 = "DEVIL"
/12 = "SLIME"
/13 = "DIVORCE"
/14 = "FAILURE"
/15 = "FRAUD"
/16 = "TERRIBLE"
/17 = "POLLUTE"
/18 = "SCUM"
/19 = "UGLY"
/20 = "HUMILIATE"
/21 = "STINK"
/22 = "WASTE"
/23 = "SNOB"
/24 = "FILTH"
</item>

<item PleasantTargets>
/1 = "SWEET"
/2 = "LUCKY"
/3 = "THANKFUL"
/4 = "PRETTY"
/5 = "FREEDOM"
/6 = "RAINBOW"
/7 = "GREAT"
/8 = "HONEST"
/9 = "PEACE"
/10 = "HEAVEN"
/11 = "PLEASURE"
/12 = "EASY"
/13 = "TRUTH"
/14 = "FRIEND"
/15 = "CHEER"
/16 = "HOPE"
/17 = "WONDERFUL"
/18 = "HUMOR"
/19 = "SUNSET"
/20 = "TERRIFIC"
/21 = "MIRACLE"
/22 = "SUNRISE"
/23 = "PARADISE"
/24 = "VACATION"
</item>

with

<list UP_UnpleasantPrimeitemnumbers>
/ items = (1, 2, 3, 4)
/ poolsize = 12
/ replace = false
/ resetinterval = 1
</list>

<list UU_UnpleasantPrimeitemnumbers>
/ items = (1, 2, 3, 4)
/ poolsize = 12
/ replace = false
/ resetinterval = 1
</list>

<list PP_PleasantPrimeitemnumbers>
/ items = (1, 2, 3, 4)
/ poolsize = 12
/ replace = false
/ resetinterval = 1
</list>

<list PU_PleasantPrimeitemnumbers>
/ items = (1, 2, 3, 4)
/ poolsize = 12
/ replace = false
/ resetinterval = 1
</list>

and

<trial UU_test>
/ ontrialbegin = [values.counttrials_test += 1; values.UU_test += 1]
/ ontrialbegin = [values.primecategory="Unpleasant"; values.targetcategory="Unpleasant"]

/ ontrialbegin = [values.targetitemnumber = list.UnpleasantTargetitemnumbers.nextvalue; values.primeitemnumber = list.UU_UnpleasantPrimeitemnumbers.nextvalue]
/ ontrialbegin = [trial.UU_test.insertstimulustime(shape.eraser, (values.primeduration))]
/ ontrialbegin = [trial.UU_test.insertstimulustime(text.UnpleasantTarget, (values.primeduration + values.pt_isi))]
/ ontrialend = [trial.UU_test.resetstimulusframes()]
/ stimulustimes = [0 = UnpleasantPrime]
/ beginresponsetime = values.primeduration + values.pt_isi
/ responseinterrupt = immediate
/ monkeyresponse = (18, 23)
/ isvalidresponse = [trial.UU_test.response==values.responsekeyUnpleasant || trial.UU_test.response == values.responsekeyPleasant]
/ iscorrectresponse = [trial.UU_test.response == values.responsekeyUnpleasant]

/ ontrialend = [values.prime = text.UnpleasantPrime.currentitem; values.target = text.UnpleasantTarget.currentitem]

/ ontrialend = [if (trial.UU_test.correct) {values.corr_test += 1;
                                                    values.sumRT_test += trial.UU_test.latency;
                                                    values.corr_UU_test += 1;
                                                    values.sumRT_UU_test += trial.UU_test.latency}]
/ posttrialpause = values.iti
/ errormessage = true(errorfeedback, 500)
</trial>

<trial UP_test>
/ ontrialbegin = [values.counttrials_test += 1; values.UP_test += 1]
/ ontrialbegin = [values.primecategory="Unpleasant"; values.targetcategory="Pleasant"]

/ ontrialbegin = [values.targetitemnumber = list.PleasantTargetitemnumbers.nextvalue; values.primeitemnumber = list.UP_UnpleasantPrimeitemnumbers.nextvalue]
/ ontrialbegin = [trial.UP_test.insertstimulustime(shape.eraser, (values.primeduration))]
/ ontrialbegin = [trial.UP_test.insertstimulustime(text.PleasantTarget, (values.primeduration + values.pt_isi))]
/ ontrialend = [trial.UP_test.resetstimulusframes()]
/ stimulustimes = [0 = UnpleasantPrime]
/ beginresponsetime = values.primeduration + values.pt_isi
/ responseinterrupt = immediate
/ monkeyresponse = (18, 23)
/ isvalidresponse = [trial.UP_test.response==values.responsekeyUnpleasant || trial.UP_test.response == values.responsekeyPleasant]
/ iscorrectresponse = [trial.UP_test.response == values.responsekeyPleasant]

/ ontrialend = [values.prime = text.UnpleasantPrime.currentitem; values.target = text.PleasantTarget.currentitem]

/ ontrialend = [if (trial.UP_test.correct) {values.corr_test += 1;
                                                    values.sumRT_test += trial.UP_test.latency;
                                                    values.corr_UP_test += 1;
                                                    values.sumRT_UP_test += trial.UP_test.latency}]
/ posttrialpause = values.iti
/ errormessage = true(errorfeedback, 500)
</trial>

<trial PU_test>
/ ontrialbegin = [values.counttrials_test += 1; values.PU_test += 1]
/ ontrialbegin = [values.primecategory="Pleasant"; values.targetcategory="Unpleasant"]

/ ontrialbegin = [values.targetitemnumber = list.UnpleasantTargetitemnumbers.nextvalue; values.primeitemnumber = list.PU_PleasantPrimeitemnumbers.nextvalue]
/ ontrialbegin = [trial.PU_test.insertstimulustime(shape.eraser, (values.primeduration))]
/ ontrialbegin = [trial.PU_test.insertstimulustime(text.UnpleasantTarget, (values.primeduration + values.pt_isi))]
/ ontrialend = [trial.PU_test.resetstimulusframes()]
/ stimulustimes = [0 = PleasantPrime]
/ beginresponsetime = values.primeduration + values.pt_isi
/ responseinterrupt = immediate
/ monkeyresponse = (18, 23)
/ isvalidresponse = [trial.PU_test.response==values.responsekeyUnpleasant || trial.PU_test.response == values.responsekeyPleasant]
/ iscorrectresponse = [trial.PU_test.response == values.responsekeyUnpleasant]

/ ontrialend = [values.prime = text.PleasantPrime.currentitem; values.target = text.UnpleasantTarget.currentitem]

/ ontrialend = [if (trial.PU_test.correct) {values.corr_test += 1;
                                                    values.sumRT_test += trial.PU_test.latency;
                                                    values.corr_PU_test += 1;
                                                    values.sumRT_PU_test += trial.PU_test.latency}]
/ posttrialpause = values.iti
/ errormessage = true(errorfeedback, 500)
</trial>

<trial PP_test>
/ ontrialbegin = [values.counttrials_test += 1; values.PP_test += 1]
/ ontrialbegin = [values.primecategory="Pleasant"; values.targetcategory="Pleasant"]

/ ontrialbegin = [values.targetitemnumber = list.PleasantTargetitemnumbers.nextvalue; values.primeitemnumber = list.PP_PleasantPrimeitemnumbers.nextvalue]
/ ontrialbegin = [trial.PP_test.insertstimulustime(shape.eraser, (values.primeduration))]
/ ontrialbegin = [trial.PP_test.insertstimulustime(text.PleasantTarget, (values.primeduration + values.pt_isi))]
/ ontrialend = [trial.PP_test.resetstimulusframes()]
/ stimulustimes = [0 = PleasantPrime]
/ beginresponsetime = values.primeduration + values.pt_isi
/ responseinterrupt = immediate
/ monkeyresponse = (18, 23)
/ isvalidresponse = [trial.PP_test.response==values.responsekeyUnpleasant || trial.PP_test.response == values.responsekeyPleasant]
/ iscorrectresponse = [trial.PP_test.response == values.responsekeyPleasant]

/ ontrialend = [values.prime = text.PleasantPrime.currentitem; values.target = text.PleasantTarget.currentitem]

/ ontrialend = [if (trial.PP_test.correct) {values.corr_test += 1;
                                                    values.sumRT_test += trial.PP_test.latency;
                                                    values.corr_PP_test += 1;
                                                    values.sumRT_PP_test += trial.PP_test.latency}]
/ posttrialpause = values.iti
/ errormessage = true(errorfeedback, 500)
</trial>

Is there a place where I could read up more about why this strategy works? I want to make sure I understand it so that I can make adaptations in the future. For example, I may want to reduce the number of targets. Eventually, I'd like to increase the number of primes.
By Dave - 1/27/2020

andrew.dorsey - 1/27/2020
Dave - 1/27/2020

You need to set up separate <list> elements for each trial type and then sample from those accordingly. That is

**************************************************************************************************************
**************************************************************************************************************
    EDITABLE STIMULI: change editable stimuli here
**************************************************************************************************************
**************************************************************************************************************

<item UnpleasantPrimes>
/1 = "MURDER"
/2 = "KILL"
/3 = "FAULT"
/4 = "LATE"
</item>

<item PleasantPrimes>
/1 = "HAPPY"
/2 = "LOVE"
/3 = "NICE"
/4 = "LUNCH"
</item>

<item UnpleasantTargets>
/1 = "EVIL"
/2 = "FORGET"
/3 = "STUPID"
/4 = "WORRY"
/5 = "POVERTY"
/6 = "VOMIT"
/7 = "IDIOT"
/8 = "ROTTEN"
/9 = "HEADACHE"
/10 = "LOUSY"
/11 = "DEVIL"
/12 = "SLIME"
/13 = "DIVORCE"
/14 = "FAILURE"
/15 = "FRAUD"
/16 = "TERRIBLE"
/17 = "POLLUTE"
/18 = "SCUM"
/19 = "UGLY"
/20 = "HUMILIATE"
/21 = "STINK"
/22 = "WASTE"
/23 = "SNOB"
/24 = "FILTH"
</item>

<item PleasantTargets>
/1 = "SWEET"
/2 = "LUCKY"
/3 = "THANKFUL"
/4 = "PRETTY"
/5 = "FREEDOM"
/6 = "RAINBOW"
/7 = "GREAT"
/8 = "HONEST"
/9 = "PEACE"
/10 = "HEAVEN"
/11 = "PLEASURE"
/12 = "EASY"
/13 = "TRUTH"
/14 = "FRIEND"
/15 = "CHEER"
/16 = "HOPE"
/17 = "WONDERFUL"
/18 = "HUMOR"
/19 = "SUNSET"
/20 = "TERRIFIC"
/21 = "MIRACLE"
/22 = "SUNRISE"
/23 = "PARADISE"
/24 = "VACATION"
</item>

with

<list UP_UnpleasantPrimeitemnumbers>
/ items = (1, 2, 3, 4)
/ poolsize = 12
/ replace = false
/ resetinterval = 1
</list>

<list UU_UnpleasantPrimeitemnumbers>
/ items = (1, 2, 3, 4)
/ poolsize = 12
/ replace = false
/ resetinterval = 1
</list>

<list PP_PleasantPrimeitemnumbers>
/ items = (1, 2, 3, 4)
/ poolsize = 12
/ replace = false
/ resetinterval = 1
</list>

<list PU_PleasantPrimeitemnumbers>
/ items = (1, 2, 3, 4)
/ poolsize = 12
/ replace = false
/ resetinterval = 1
</list>

and

<trial UU_test>
/ ontrialbegin = [values.counttrials_test += 1; values.UU_test += 1]
/ ontrialbegin = [values.primecategory="Unpleasant"; values.targetcategory="Unpleasant"]

/ ontrialbegin = [values.targetitemnumber = list.UnpleasantTargetitemnumbers.nextvalue; values.primeitemnumber = list.UU_UnpleasantPrimeitemnumbers.nextvalue]
/ ontrialbegin = [trial.UU_test.insertstimulustime(shape.eraser, (values.primeduration))]
/ ontrialbegin = [trial.UU_test.insertstimulustime(text.UnpleasantTarget, (values.primeduration + values.pt_isi))]
/ ontrialend = [trial.UU_test.resetstimulusframes()]
/ stimulustimes = [0 = UnpleasantPrime]
/ beginresponsetime = values.primeduration + values.pt_isi
/ responseinterrupt = immediate
/ monkeyresponse = (18, 23)
/ isvalidresponse = [trial.UU_test.response==values.responsekeyUnpleasant || trial.UU_test.response == values.responsekeyPleasant]
/ iscorrectresponse = [trial.UU_test.response == values.responsekeyUnpleasant]

/ ontrialend = [values.prime = text.UnpleasantPrime.currentitem; values.target = text.UnpleasantTarget.currentitem]

/ ontrialend = [if (trial.UU_test.correct) {values.corr_test += 1;
                                                    values.sumRT_test += trial.UU_test.latency;
                                                    values.corr_UU_test += 1;
                                                    values.sumRT_UU_test += trial.UU_test.latency}]
/ posttrialpause = values.iti
/ errormessage = true(errorfeedback, 500)
</trial>

<trial UP_test>
/ ontrialbegin = [values.counttrials_test += 1; values.UP_test += 1]
/ ontrialbegin = [values.primecategory="Unpleasant"; values.targetcategory="Pleasant"]

/ ontrialbegin = [values.targetitemnumber = list.PleasantTargetitemnumbers.nextvalue; values.primeitemnumber = list.UP_UnpleasantPrimeitemnumbers.nextvalue]
/ ontrialbegin = [trial.UP_test.insertstimulustime(shape.eraser, (values.primeduration))]
/ ontrialbegin = [trial.UP_test.insertstimulustime(text.PleasantTarget, (values.primeduration + values.pt_isi))]
/ ontrialend = [trial.UP_test.resetstimulusframes()]
/ stimulustimes = [0 = UnpleasantPrime]
/ beginresponsetime = values.primeduration + values.pt_isi
/ responseinterrupt = immediate
/ monkeyresponse = (18, 23)
/ isvalidresponse = [trial.UP_test.response==values.responsekeyUnpleasant || trial.UP_test.response == values.responsekeyPleasant]
/ iscorrectresponse = [trial.UP_test.response == values.responsekeyPleasant]

/ ontrialend = [values.prime = text.UnpleasantPrime.currentitem; values.target = text.PleasantTarget.currentitem]

/ ontrialend = [if (trial.UP_test.correct) {values.corr_test += 1;
                                                    values.sumRT_test += trial.UP_test.latency;
                                                    values.corr_UP_test += 1;
                                                    values.sumRT_UP_test += trial.UP_test.latency}]
/ posttrialpause = values.iti
/ errormessage = true(errorfeedback, 500)
</trial>

<trial PU_test>
/ ontrialbegin = [values.counttrials_test += 1; values.PU_test += 1]
/ ontrialbegin = [values.primecategory="Pleasant"; values.targetcategory="Unpleasant"]

/ ontrialbegin = [values.targetitemnumber = list.UnpleasantTargetitemnumbers.nextvalue; values.primeitemnumber = list.PU_PleasantPrimeitemnumbers.nextvalue]
/ ontrialbegin = [trial.PU_test.insertstimulustime(shape.eraser, (values.primeduration))]
/ ontrialbegin = [trial.PU_test.insertstimulustime(text.UnpleasantTarget, (values.primeduration + values.pt_isi))]
/ ontrialend = [trial.PU_test.resetstimulusframes()]
/ stimulustimes = [0 = PleasantPrime]
/ beginresponsetime = values.primeduration + values.pt_isi
/ responseinterrupt = immediate
/ monkeyresponse = (18, 23)
/ isvalidresponse = [trial.PU_test.response==values.responsekeyUnpleasant || trial.PU_test.response == values.responsekeyPleasant]
/ iscorrectresponse = [trial.PU_test.response == values.responsekeyUnpleasant]

/ ontrialend = [values.prime = text.PleasantPrime.currentitem; values.target = text.UnpleasantTarget.currentitem]

/ ontrialend = [if (trial.PU_test.correct) {values.corr_test += 1;
                                                    values.sumRT_test += trial.PU_test.latency;
                                                    values.corr_PU_test += 1;
                                                    values.sumRT_PU_test += trial.PU_test.latency}]
/ posttrialpause = values.iti
/ errormessage = true(errorfeedback, 500)
</trial>

<trial PP_test>
/ ontrialbegin = [values.counttrials_test += 1; values.PP_test += 1]
/ ontrialbegin = [values.primecategory="Pleasant"; values.targetcategory="Pleasant"]

/ ontrialbegin = [values.targetitemnumber = list.PleasantTargetitemnumbers.nextvalue; values.primeitemnumber = list.PP_PleasantPrimeitemnumbers.nextvalue]
/ ontrialbegin = [trial.PP_test.insertstimulustime(shape.eraser, (values.primeduration))]
/ ontrialbegin = [trial.PP_test.insertstimulustime(text.PleasantTarget, (values.primeduration + values.pt_isi))]
/ ontrialend = [trial.PP_test.resetstimulusframes()]
/ stimulustimes = [0 = PleasantPrime]
/ beginresponsetime = values.primeduration + values.pt_isi
/ responseinterrupt = immediate
/ monkeyresponse = (18, 23)
/ isvalidresponse = [trial.PP_test.response==values.responsekeyUnpleasant || trial.PP_test.response == values.responsekeyPleasant]
/ iscorrectresponse = [trial.PP_test.response == values.responsekeyPleasant]

/ ontrialend = [values.prime = text.PleasantPrime.currentitem; values.target = text.PleasantTarget.currentitem]

/ ontrialend = [if (trial.PP_test.correct) {values.corr_test += 1;
                                                    values.sumRT_test += trial.PP_test.latency;
                                                    values.corr_PP_test += 1;
                                                    values.sumRT_PP_test += trial.PP_test.latency}]
/ posttrialpause = values.iti
/ errormessage = true(errorfeedback, 500)
</trial>

Is there a place where I could read up more about why this strategy works? I want to make sure I understand it so that I can make adaptations in the future. For example, I may want to reduce the number of targets. Eventually, I'd like to increase the number of primes.

It's just basic sampling. I've explained some of that here: https://www.millisecond.com/forums/FindPost14400.aspx or here https://www.millisecond.com/forums/FindPost12483.aspx
By andrew.dorsey - 1/27/2020

Dave - 1/27/2020
andrew.dorsey - 1/27/2020
Dave - 1/27/2020

You need to set up separate <list> elements for each trial type and then sample from those accordingly. That is

**************************************************************************************************************
**************************************************************************************************************
    EDITABLE STIMULI: change editable stimuli here
**************************************************************************************************************
**************************************************************************************************************

<item UnpleasantPrimes>
/1 = "MURDER"
/2 = "KILL"
/3 = "FAULT"
/4 = "LATE"
</item>

<item PleasantPrimes>
/1 = "HAPPY"
/2 = "LOVE"
/3 = "NICE"
/4 = "LUNCH"
</item>

<item UnpleasantTargets>
/1 = "EVIL"
/2 = "FORGET"
/3 = "STUPID"
/4 = "WORRY"
/5 = "POVERTY"
/6 = "VOMIT"
/7 = "IDIOT"
/8 = "ROTTEN"
/9 = "HEADACHE"
/10 = "LOUSY"
/11 = "DEVIL"
/12 = "SLIME"
/13 = "DIVORCE"
/14 = "FAILURE"
/15 = "FRAUD"
/16 = "TERRIBLE"
/17 = "POLLUTE"
/18 = "SCUM"
/19 = "UGLY"
/20 = "HUMILIATE"
/21 = "STINK"
/22 = "WASTE"
/23 = "SNOB"
/24 = "FILTH"
</item>

<item PleasantTargets>
/1 = "SWEET"
/2 = "LUCKY"
/3 = "THANKFUL"
/4 = "PRETTY"
/5 = "FREEDOM"
/6 = "RAINBOW"
/7 = "GREAT"
/8 = "HONEST"
/9 = "PEACE"
/10 = "HEAVEN"
/11 = "PLEASURE"
/12 = "EASY"
/13 = "TRUTH"
/14 = "FRIEND"
/15 = "CHEER"
/16 = "HOPE"
/17 = "WONDERFUL"
/18 = "HUMOR"
/19 = "SUNSET"
/20 = "TERRIFIC"
/21 = "MIRACLE"
/22 = "SUNRISE"
/23 = "PARADISE"
/24 = "VACATION"
</item>

with

<list UP_UnpleasantPrimeitemnumbers>
/ items = (1, 2, 3, 4)
/ poolsize = 12
/ replace = false
/ resetinterval = 1
</list>

<list UU_UnpleasantPrimeitemnumbers>
/ items = (1, 2, 3, 4)
/ poolsize = 12
/ replace = false
/ resetinterval = 1
</list>

<list PP_PleasantPrimeitemnumbers>
/ items = (1, 2, 3, 4)
/ poolsize = 12
/ replace = false
/ resetinterval = 1
</list>

<list PU_PleasantPrimeitemnumbers>
/ items = (1, 2, 3, 4)
/ poolsize = 12
/ replace = false
/ resetinterval = 1
</list>

and

<trial UU_test>
/ ontrialbegin = [values.counttrials_test += 1; values.UU_test += 1]
/ ontrialbegin = [values.primecategory="Unpleasant"; values.targetcategory="Unpleasant"]

/ ontrialbegin = [values.targetitemnumber = list.UnpleasantTargetitemnumbers.nextvalue; values.primeitemnumber = list.UU_UnpleasantPrimeitemnumbers.nextvalue]
/ ontrialbegin = [trial.UU_test.insertstimulustime(shape.eraser, (values.primeduration))]
/ ontrialbegin = [trial.UU_test.insertstimulustime(text.UnpleasantTarget, (values.primeduration + values.pt_isi))]
/ ontrialend = [trial.UU_test.resetstimulusframes()]
/ stimulustimes = [0 = UnpleasantPrime]
/ beginresponsetime = values.primeduration + values.pt_isi
/ responseinterrupt = immediate
/ monkeyresponse = (18, 23)
/ isvalidresponse = [trial.UU_test.response==values.responsekeyUnpleasant || trial.UU_test.response == values.responsekeyPleasant]
/ iscorrectresponse = [trial.UU_test.response == values.responsekeyUnpleasant]

/ ontrialend = [values.prime = text.UnpleasantPrime.currentitem; values.target = text.UnpleasantTarget.currentitem]

/ ontrialend = [if (trial.UU_test.correct) {values.corr_test += 1;
                                                    values.sumRT_test += trial.UU_test.latency;
                                                    values.corr_UU_test += 1;
                                                    values.sumRT_UU_test += trial.UU_test.latency}]
/ posttrialpause = values.iti
/ errormessage = true(errorfeedback, 500)
</trial>

<trial UP_test>
/ ontrialbegin = [values.counttrials_test += 1; values.UP_test += 1]
/ ontrialbegin = [values.primecategory="Unpleasant"; values.targetcategory="Pleasant"]

/ ontrialbegin = [values.targetitemnumber = list.PleasantTargetitemnumbers.nextvalue; values.primeitemnumber = list.UP_UnpleasantPrimeitemnumbers.nextvalue]
/ ontrialbegin = [trial.UP_test.insertstimulustime(shape.eraser, (values.primeduration))]
/ ontrialbegin = [trial.UP_test.insertstimulustime(text.PleasantTarget, (values.primeduration + values.pt_isi))]
/ ontrialend = [trial.UP_test.resetstimulusframes()]
/ stimulustimes = [0 = UnpleasantPrime]
/ beginresponsetime = values.primeduration + values.pt_isi
/ responseinterrupt = immediate
/ monkeyresponse = (18, 23)
/ isvalidresponse = [trial.UP_test.response==values.responsekeyUnpleasant || trial.UP_test.response == values.responsekeyPleasant]
/ iscorrectresponse = [trial.UP_test.response == values.responsekeyPleasant]

/ ontrialend = [values.prime = text.UnpleasantPrime.currentitem; values.target = text.PleasantTarget.currentitem]

/ ontrialend = [if (trial.UP_test.correct) {values.corr_test += 1;
                                                    values.sumRT_test += trial.UP_test.latency;
                                                    values.corr_UP_test += 1;
                                                    values.sumRT_UP_test += trial.UP_test.latency}]
/ posttrialpause = values.iti
/ errormessage = true(errorfeedback, 500)
</trial>

<trial PU_test>
/ ontrialbegin = [values.counttrials_test += 1; values.PU_test += 1]
/ ontrialbegin = [values.primecategory="Pleasant"; values.targetcategory="Unpleasant"]

/ ontrialbegin = [values.targetitemnumber = list.UnpleasantTargetitemnumbers.nextvalue; values.primeitemnumber = list.PU_PleasantPrimeitemnumbers.nextvalue]
/ ontrialbegin = [trial.PU_test.insertstimulustime(shape.eraser, (values.primeduration))]
/ ontrialbegin = [trial.PU_test.insertstimulustime(text.UnpleasantTarget, (values.primeduration + values.pt_isi))]
/ ontrialend = [trial.PU_test.resetstimulusframes()]
/ stimulustimes = [0 = PleasantPrime]
/ beginresponsetime = values.primeduration + values.pt_isi
/ responseinterrupt = immediate
/ monkeyresponse = (18, 23)
/ isvalidresponse = [trial.PU_test.response==values.responsekeyUnpleasant || trial.PU_test.response == values.responsekeyPleasant]
/ iscorrectresponse = [trial.PU_test.response == values.responsekeyUnpleasant]

/ ontrialend = [values.prime = text.PleasantPrime.currentitem; values.target = text.UnpleasantTarget.currentitem]

/ ontrialend = [if (trial.PU_test.correct) {values.corr_test += 1;
                                                    values.sumRT_test += trial.PU_test.latency;
                                                    values.corr_PU_test += 1;
                                                    values.sumRT_PU_test += trial.PU_test.latency}]
/ posttrialpause = values.iti
/ errormessage = true(errorfeedback, 500)
</trial>

<trial PP_test>
/ ontrialbegin = [values.counttrials_test += 1; values.PP_test += 1]
/ ontrialbegin = [values.primecategory="Pleasant"; values.targetcategory="Pleasant"]

/ ontrialbegin = [values.targetitemnumber = list.PleasantTargetitemnumbers.nextvalue; values.primeitemnumber = list.PP_PleasantPrimeitemnumbers.nextvalue]
/ ontrialbegin = [trial.PP_test.insertstimulustime(shape.eraser, (values.primeduration))]
/ ontrialbegin = [trial.PP_test.insertstimulustime(text.PleasantTarget, (values.primeduration + values.pt_isi))]
/ ontrialend = [trial.PP_test.resetstimulusframes()]
/ stimulustimes = [0 = PleasantPrime]
/ beginresponsetime = values.primeduration + values.pt_isi
/ responseinterrupt = immediate
/ monkeyresponse = (18, 23)
/ isvalidresponse = [trial.PP_test.response==values.responsekeyUnpleasant || trial.PP_test.response == values.responsekeyPleasant]
/ iscorrectresponse = [trial.PP_test.response == values.responsekeyPleasant]

/ ontrialend = [values.prime = text.PleasantPrime.currentitem; values.target = text.PleasantTarget.currentitem]

/ ontrialend = [if (trial.PP_test.correct) {values.corr_test += 1;
                                                    values.sumRT_test += trial.PP_test.latency;
                                                    values.corr_PP_test += 1;
                                                    values.sumRT_PP_test += trial.PP_test.latency}]
/ posttrialpause = values.iti
/ errormessage = true(errorfeedback, 500)
</trial>

Is there a place where I could read up more about why this strategy works? I want to make sure I understand it so that I can make adaptations in the future. For example, I may want to reduce the number of targets. Eventually, I'd like to increase the number of primes.

It's just basic sampling. I've explained some of that here: https://www.millisecond.com/forums/FindPost14400.aspx or here https://www.millisecond.com/forums/FindPost12483.aspx

Final question: Can I just put this same code into an Inquisit 6 file and still get the performance I'm looking for? I think the presentation is a bit better visually in Inquisit 6 compared to Inquisit 4.
By andrew.dorsey - 1/27/2020

andrew.dorsey - 1/28/2020
Dave - 1/27/2020
andrew.dorsey - 1/27/2020
Dave - 1/27/2020

You need to set up separate <list> elements for each trial type and then sample from those accordingly. That is

**************************************************************************************************************
**************************************************************************************************************
    EDITABLE STIMULI: change editable stimuli here
**************************************************************************************************************
**************************************************************************************************************

<item UnpleasantPrimes>
/1 = "MURDER"
/2 = "KILL"
/3 = "FAULT"
/4 = "LATE"
</item>

<item PleasantPrimes>
/1 = "HAPPY"
/2 = "LOVE"
/3 = "NICE"
/4 = "LUNCH"
</item>

<item UnpleasantTargets>
/1 = "EVIL"
/2 = "FORGET"
/3 = "STUPID"
/4 = "WORRY"
/5 = "POVERTY"
/6 = "VOMIT"
/7 = "IDIOT"
/8 = "ROTTEN"
/9 = "HEADACHE"
/10 = "LOUSY"
/11 = "DEVIL"
/12 = "SLIME"
/13 = "DIVORCE"
/14 = "FAILURE"
/15 = "FRAUD"
/16 = "TERRIBLE"
/17 = "POLLUTE"
/18 = "SCUM"
/19 = "UGLY"
/20 = "HUMILIATE"
/21 = "STINK"
/22 = "WASTE"
/23 = "SNOB"
/24 = "FILTH"
</item>

<item PleasantTargets>
/1 = "SWEET"
/2 = "LUCKY"
/3 = "THANKFUL"
/4 = "PRETTY"
/5 = "FREEDOM"
/6 = "RAINBOW"
/7 = "GREAT"
/8 = "HONEST"
/9 = "PEACE"
/10 = "HEAVEN"
/11 = "PLEASURE"
/12 = "EASY"
/13 = "TRUTH"
/14 = "FRIEND"
/15 = "CHEER"
/16 = "HOPE"
/17 = "WONDERFUL"
/18 = "HUMOR"
/19 = "SUNSET"
/20 = "TERRIFIC"
/21 = "MIRACLE"
/22 = "SUNRISE"
/23 = "PARADISE"
/24 = "VACATION"
</item>

with

<list UP_UnpleasantPrimeitemnumbers>
/ items = (1, 2, 3, 4)
/ poolsize = 12
/ replace = false
/ resetinterval = 1
</list>

<list UU_UnpleasantPrimeitemnumbers>
/ items = (1, 2, 3, 4)
/ poolsize = 12
/ replace = false
/ resetinterval = 1
</list>

<list PP_PleasantPrimeitemnumbers>
/ items = (1, 2, 3, 4)
/ poolsize = 12
/ replace = false
/ resetinterval = 1
</list>

<list PU_PleasantPrimeitemnumbers>
/ items = (1, 2, 3, 4)
/ poolsize = 12
/ replace = false
/ resetinterval = 1
</list>

and

<trial UU_test>
/ ontrialbegin = [values.counttrials_test += 1; values.UU_test += 1]
/ ontrialbegin = [values.primecategory="Unpleasant"; values.targetcategory="Unpleasant"]

/ ontrialbegin = [values.targetitemnumber = list.UnpleasantTargetitemnumbers.nextvalue; values.primeitemnumber = list.UU_UnpleasantPrimeitemnumbers.nextvalue]
/ ontrialbegin = [trial.UU_test.insertstimulustime(shape.eraser, (values.primeduration))]
/ ontrialbegin = [trial.UU_test.insertstimulustime(text.UnpleasantTarget, (values.primeduration + values.pt_isi))]
/ ontrialend = [trial.UU_test.resetstimulusframes()]
/ stimulustimes = [0 = UnpleasantPrime]
/ beginresponsetime = values.primeduration + values.pt_isi
/ responseinterrupt = immediate
/ monkeyresponse = (18, 23)
/ isvalidresponse = [trial.UU_test.response==values.responsekeyUnpleasant || trial.UU_test.response == values.responsekeyPleasant]
/ iscorrectresponse = [trial.UU_test.response == values.responsekeyUnpleasant]

/ ontrialend = [values.prime = text.UnpleasantPrime.currentitem; values.target = text.UnpleasantTarget.currentitem]

/ ontrialend = [if (trial.UU_test.correct) {values.corr_test += 1;
                                                    values.sumRT_test += trial.UU_test.latency;
                                                    values.corr_UU_test += 1;
                                                    values.sumRT_UU_test += trial.UU_test.latency}]
/ posttrialpause = values.iti
/ errormessage = true(errorfeedback, 500)
</trial>

<trial UP_test>
/ ontrialbegin = [values.counttrials_test += 1; values.UP_test += 1]
/ ontrialbegin = [values.primecategory="Unpleasant"; values.targetcategory="Pleasant"]

/ ontrialbegin = [values.targetitemnumber = list.PleasantTargetitemnumbers.nextvalue; values.primeitemnumber = list.UP_UnpleasantPrimeitemnumbers.nextvalue]
/ ontrialbegin = [trial.UP_test.insertstimulustime(shape.eraser, (values.primeduration))]
/ ontrialbegin = [trial.UP_test.insertstimulustime(text.PleasantTarget, (values.primeduration + values.pt_isi))]
/ ontrialend = [trial.UP_test.resetstimulusframes()]
/ stimulustimes = [0 = UnpleasantPrime]
/ beginresponsetime = values.primeduration + values.pt_isi
/ responseinterrupt = immediate
/ monkeyresponse = (18, 23)
/ isvalidresponse = [trial.UP_test.response==values.responsekeyUnpleasant || trial.UP_test.response == values.responsekeyPleasant]
/ iscorrectresponse = [trial.UP_test.response == values.responsekeyPleasant]

/ ontrialend = [values.prime = text.UnpleasantPrime.currentitem; values.target = text.PleasantTarget.currentitem]

/ ontrialend = [if (trial.UP_test.correct) {values.corr_test += 1;
                                                    values.sumRT_test += trial.UP_test.latency;
                                                    values.corr_UP_test += 1;
                                                    values.sumRT_UP_test += trial.UP_test.latency}]
/ posttrialpause = values.iti
/ errormessage = true(errorfeedback, 500)
</trial>

<trial PU_test>
/ ontrialbegin = [values.counttrials_test += 1; values.PU_test += 1]
/ ontrialbegin = [values.primecategory="Pleasant"; values.targetcategory="Unpleasant"]

/ ontrialbegin = [values.targetitemnumber = list.UnpleasantTargetitemnumbers.nextvalue; values.primeitemnumber = list.PU_PleasantPrimeitemnumbers.nextvalue]
/ ontrialbegin = [trial.PU_test.insertstimulustime(shape.eraser, (values.primeduration))]
/ ontrialbegin = [trial.PU_test.insertstimulustime(text.UnpleasantTarget, (values.primeduration + values.pt_isi))]
/ ontrialend = [trial.PU_test.resetstimulusframes()]
/ stimulustimes = [0 = PleasantPrime]
/ beginresponsetime = values.primeduration + values.pt_isi
/ responseinterrupt = immediate
/ monkeyresponse = (18, 23)
/ isvalidresponse = [trial.PU_test.response==values.responsekeyUnpleasant || trial.PU_test.response == values.responsekeyPleasant]
/ iscorrectresponse = [trial.PU_test.response == values.responsekeyUnpleasant]

/ ontrialend = [values.prime = text.PleasantPrime.currentitem; values.target = text.UnpleasantTarget.currentitem]

/ ontrialend = [if (trial.PU_test.correct) {values.corr_test += 1;
                                                    values.sumRT_test += trial.PU_test.latency;
                                                    values.corr_PU_test += 1;
                                                    values.sumRT_PU_test += trial.PU_test.latency}]
/ posttrialpause = values.iti
/ errormessage = true(errorfeedback, 500)
</trial>

<trial PP_test>
/ ontrialbegin = [values.counttrials_test += 1; values.PP_test += 1]
/ ontrialbegin = [values.primecategory="Pleasant"; values.targetcategory="Pleasant"]

/ ontrialbegin = [values.targetitemnumber = list.PleasantTargetitemnumbers.nextvalue; values.primeitemnumber = list.PP_PleasantPrimeitemnumbers.nextvalue]
/ ontrialbegin = [trial.PP_test.insertstimulustime(shape.eraser, (values.primeduration))]
/ ontrialbegin = [trial.PP_test.insertstimulustime(text.PleasantTarget, (values.primeduration + values.pt_isi))]
/ ontrialend = [trial.PP_test.resetstimulusframes()]
/ stimulustimes = [0 = PleasantPrime]
/ beginresponsetime = values.primeduration + values.pt_isi
/ responseinterrupt = immediate
/ monkeyresponse = (18, 23)
/ isvalidresponse = [trial.PP_test.response==values.responsekeyUnpleasant || trial.PP_test.response == values.responsekeyPleasant]
/ iscorrectresponse = [trial.PP_test.response == values.responsekeyPleasant]

/ ontrialend = [values.prime = text.PleasantPrime.currentitem; values.target = text.PleasantTarget.currentitem]

/ ontrialend = [if (trial.PP_test.correct) {values.corr_test += 1;
                                                    values.sumRT_test += trial.PP_test.latency;
                                                    values.corr_PP_test += 1;
                                                    values.sumRT_PP_test += trial.PP_test.latency}]
/ posttrialpause = values.iti
/ errormessage = true(errorfeedback, 500)
</trial>

Is there a place where I could read up more about why this strategy works? I want to make sure I understand it so that I can make adaptations in the future. For example, I may want to reduce the number of targets. Eventually, I'd like to increase the number of primes.

It's just basic sampling. I've explained some of that here: https://www.millisecond.com/forums/FindPost14400.aspx or here https://www.millisecond.com/forums/FindPost12483.aspx

Final question: Can I just put this same code into an Inquisit 6 file and still get the performance I'm looking for? I think the presentation is a bit better visually in Inquisit 6 compared to Inquisit 4.

I guess what I'm saying is that I ultimately want an Inquisit 6 script that works like the one you attached earlier in the thread.
By Dave - 1/27/2020

andrew.dorsey - 1/28/2020
andrew.dorsey - 1/28/2020
Dave - 1/27/2020
andrew.dorsey - 1/27/2020
Dave - 1/27/2020

You need to set up separate <list> elements for each trial type and then sample from those accordingly. That is

**************************************************************************************************************
**************************************************************************************************************
    EDITABLE STIMULI: change editable stimuli here
**************************************************************************************************************
**************************************************************************************************************

<item UnpleasantPrimes>
/1 = "MURDER"
/2 = "KILL"
/3 = "FAULT"
/4 = "LATE"
</item>

<item PleasantPrimes>
/1 = "HAPPY"
/2 = "LOVE"
/3 = "NICE"
/4 = "LUNCH"
</item>

<item UnpleasantTargets>
/1 = "EVIL"
/2 = "FORGET"
/3 = "STUPID"
/4 = "WORRY"
/5 = "POVERTY"
/6 = "VOMIT"
/7 = "IDIOT"
/8 = "ROTTEN"
/9 = "HEADACHE"
/10 = "LOUSY"
/11 = "DEVIL"
/12 = "SLIME"
/13 = "DIVORCE"
/14 = "FAILURE"
/15 = "FRAUD"
/16 = "TERRIBLE"
/17 = "POLLUTE"
/18 = "SCUM"
/19 = "UGLY"
/20 = "HUMILIATE"
/21 = "STINK"
/22 = "WASTE"
/23 = "SNOB"
/24 = "FILTH"
</item>

<item PleasantTargets>
/1 = "SWEET"
/2 = "LUCKY"
/3 = "THANKFUL"
/4 = "PRETTY"
/5 = "FREEDOM"
/6 = "RAINBOW"
/7 = "GREAT"
/8 = "HONEST"
/9 = "PEACE"
/10 = "HEAVEN"
/11 = "PLEASURE"
/12 = "EASY"
/13 = "TRUTH"
/14 = "FRIEND"
/15 = "CHEER"
/16 = "HOPE"
/17 = "WONDERFUL"
/18 = "HUMOR"
/19 = "SUNSET"
/20 = "TERRIFIC"
/21 = "MIRACLE"
/22 = "SUNRISE"
/23 = "PARADISE"
/24 = "VACATION"
</item>

with

<list UP_UnpleasantPrimeitemnumbers>
/ items = (1, 2, 3, 4)
/ poolsize = 12
/ replace = false
/ resetinterval = 1
</list>

<list UU_UnpleasantPrimeitemnumbers>
/ items = (1, 2, 3, 4)
/ poolsize = 12
/ replace = false
/ resetinterval = 1
</list>

<list PP_PleasantPrimeitemnumbers>
/ items = (1, 2, 3, 4)
/ poolsize = 12
/ replace = false
/ resetinterval = 1
</list>

<list PU_PleasantPrimeitemnumbers>
/ items = (1, 2, 3, 4)
/ poolsize = 12
/ replace = false
/ resetinterval = 1
</list>

and

<trial UU_test>
/ ontrialbegin = [values.counttrials_test += 1; values.UU_test += 1]
/ ontrialbegin = [values.primecategory="Unpleasant"; values.targetcategory="Unpleasant"]

/ ontrialbegin = [values.targetitemnumber = list.UnpleasantTargetitemnumbers.nextvalue; values.primeitemnumber = list.UU_UnpleasantPrimeitemnumbers.nextvalue]
/ ontrialbegin = [trial.UU_test.insertstimulustime(shape.eraser, (values.primeduration))]
/ ontrialbegin = [trial.UU_test.insertstimulustime(text.UnpleasantTarget, (values.primeduration + values.pt_isi))]
/ ontrialend = [trial.UU_test.resetstimulusframes()]
/ stimulustimes = [0 = UnpleasantPrime]
/ beginresponsetime = values.primeduration + values.pt_isi
/ responseinterrupt = immediate
/ monkeyresponse = (18, 23)
/ isvalidresponse = [trial.UU_test.response==values.responsekeyUnpleasant || trial.UU_test.response == values.responsekeyPleasant]
/ iscorrectresponse = [trial.UU_test.response == values.responsekeyUnpleasant]

/ ontrialend = [values.prime = text.UnpleasantPrime.currentitem; values.target = text.UnpleasantTarget.currentitem]

/ ontrialend = [if (trial.UU_test.correct) {values.corr_test += 1;
                                                    values.sumRT_test += trial.UU_test.latency;
                                                    values.corr_UU_test += 1;
                                                    values.sumRT_UU_test += trial.UU_test.latency}]
/ posttrialpause = values.iti
/ errormessage = true(errorfeedback, 500)
</trial>

<trial UP_test>
/ ontrialbegin = [values.counttrials_test += 1; values.UP_test += 1]
/ ontrialbegin = [values.primecategory="Unpleasant"; values.targetcategory="Pleasant"]

/ ontrialbegin = [values.targetitemnumber = list.PleasantTargetitemnumbers.nextvalue; values.primeitemnumber = list.UP_UnpleasantPrimeitemnumbers.nextvalue]
/ ontrialbegin = [trial.UP_test.insertstimulustime(shape.eraser, (values.primeduration))]
/ ontrialbegin = [trial.UP_test.insertstimulustime(text.PleasantTarget, (values.primeduration + values.pt_isi))]
/ ontrialend = [trial.UP_test.resetstimulusframes()]
/ stimulustimes = [0 = UnpleasantPrime]
/ beginresponsetime = values.primeduration + values.pt_isi
/ responseinterrupt = immediate
/ monkeyresponse = (18, 23)
/ isvalidresponse = [trial.UP_test.response==values.responsekeyUnpleasant || trial.UP_test.response == values.responsekeyPleasant]
/ iscorrectresponse = [trial.UP_test.response == values.responsekeyPleasant]

/ ontrialend = [values.prime = text.UnpleasantPrime.currentitem; values.target = text.PleasantTarget.currentitem]

/ ontrialend = [if (trial.UP_test.correct) {values.corr_test += 1;
                                                    values.sumRT_test += trial.UP_test.latency;
                                                    values.corr_UP_test += 1;
                                                    values.sumRT_UP_test += trial.UP_test.latency}]
/ posttrialpause = values.iti
/ errormessage = true(errorfeedback, 500)
</trial>

<trial PU_test>
/ ontrialbegin = [values.counttrials_test += 1; values.PU_test += 1]
/ ontrialbegin = [values.primecategory="Pleasant"; values.targetcategory="Unpleasant"]

/ ontrialbegin = [values.targetitemnumber = list.UnpleasantTargetitemnumbers.nextvalue; values.primeitemnumber = list.PU_PleasantPrimeitemnumbers.nextvalue]
/ ontrialbegin = [trial.PU_test.insertstimulustime(shape.eraser, (values.primeduration))]
/ ontrialbegin = [trial.PU_test.insertstimulustime(text.UnpleasantTarget, (values.primeduration + values.pt_isi))]
/ ontrialend = [trial.PU_test.resetstimulusframes()]
/ stimulustimes = [0 = PleasantPrime]
/ beginresponsetime = values.primeduration + values.pt_isi
/ responseinterrupt = immediate
/ monkeyresponse = (18, 23)
/ isvalidresponse = [trial.PU_test.response==values.responsekeyUnpleasant || trial.PU_test.response == values.responsekeyPleasant]
/ iscorrectresponse = [trial.PU_test.response == values.responsekeyUnpleasant]

/ ontrialend = [values.prime = text.PleasantPrime.currentitem; values.target = text.UnpleasantTarget.currentitem]

/ ontrialend = [if (trial.PU_test.correct) {values.corr_test += 1;
                                                    values.sumRT_test += trial.PU_test.latency;
                                                    values.corr_PU_test += 1;
                                                    values.sumRT_PU_test += trial.PU_test.latency}]
/ posttrialpause = values.iti
/ errormessage = true(errorfeedback, 500)
</trial>

<trial PP_test>
/ ontrialbegin = [values.counttrials_test += 1; values.PP_test += 1]
/ ontrialbegin = [values.primecategory="Pleasant"; values.targetcategory="Pleasant"]

/ ontrialbegin = [values.targetitemnumber = list.PleasantTargetitemnumbers.nextvalue; values.primeitemnumber = list.PP_PleasantPrimeitemnumbers.nextvalue]
/ ontrialbegin = [trial.PP_test.insertstimulustime(shape.eraser, (values.primeduration))]
/ ontrialbegin = [trial.PP_test.insertstimulustime(text.PleasantTarget, (values.primeduration + values.pt_isi))]
/ ontrialend = [trial.PP_test.resetstimulusframes()]
/ stimulustimes = [0 = PleasantPrime]
/ beginresponsetime = values.primeduration + values.pt_isi
/ responseinterrupt = immediate
/ monkeyresponse = (18, 23)
/ isvalidresponse = [trial.PP_test.response==values.responsekeyUnpleasant || trial.PP_test.response == values.responsekeyPleasant]
/ iscorrectresponse = [trial.PP_test.response == values.responsekeyPleasant]

/ ontrialend = [values.prime = text.PleasantPrime.currentitem; values.target = text.PleasantTarget.currentitem]

/ ontrialend = [if (trial.PP_test.correct) {values.corr_test += 1;
                                                    values.sumRT_test += trial.PP_test.latency;
                                                    values.corr_PP_test += 1;
                                                    values.sumRT_PP_test += trial.PP_test.latency}]
/ posttrialpause = values.iti
/ errormessage = true(errorfeedback, 500)
</trial>

Is there a place where I could read up more about why this strategy works? I want to make sure I understand it so that I can make adaptations in the future. For example, I may want to reduce the number of targets. Eventually, I'd like to increase the number of primes.

It's just basic sampling. I've explained some of that here: https://www.millisecond.com/forums/FindPost14400.aspx or here https://www.millisecond.com/forums/FindPost12483.aspx

Final question: Can I just put this same code into an Inquisit 6 file and still get the performance I'm looking for? I think the presentation is a bit better visually in Inquisit 6 compared to Inquisit 4.

I guess what I'm saying is that I ultimately want an Inquisit 6 script that works like the one you attached earlier in the thread.

Yes, this works the exact same way in Inquisit 6. See attached.
By babj - 1/29/2020

I'm also using this affective priming script but I'm wondering about how I can incorporate 8 self-report questions into the same study. That is, I want to have people complete the priming procedure and then complete 8 self-report questions. I'd like to randomize it so the affective priming procedure and self-report questions come first in the study equally often. 

I've seen the tutorial on demographic surveys (https://www.millisecond.com/support/docs/v6/html/viewer.htm#tutorials/demographic_survey/surveytutorial.htm), but I'm still not clear how to (a) incorporate this information into the affective priming script or (b) how to counterbalance the order of the self-report questions and affective priming procedure.
By Dave - 1/29/2020

babj - 1/29/2020
I'm also using this affective priming script but I'm wondering about how I can incorporate 8 self-report questions into the same study. That is, I want to have people complete the priming procedure and then complete 8 self-report questions. I'd like to randomize it so the affective priming procedure and self-report questions come first in the study equally often. 

I've seen the tutorial on demographic surveys (https://www.millisecond.com/support/docs/v6/html/viewer.htm#tutorials/demographic_survey/surveytutorial.htm), but I'm still not clear how to (a) incorporate this information into the affective priming script or (b) how to counterbalance the order of the self-report questions and affective priming procedure.

A <survey> is a kind of <block>. (Note: You can also run your <surveypage>s, which are special <trial> elements, via a regular <block>'s /trials attribute). In either case, you run the demographics <survey> or  <block> like any other block via the <expt> element's /blocks attribute. If you want to counterbalance, you need two <expt> elements, that is

// priming first
<expt >
/ onexptbegin = [
    values.responsekeyUnpleasant = parameters.responsekeyleft;
    values.responsekeyUnpleasant_label = parameters.responsekeyleft_label;
    values.responsekeyPleasant = parameters.responsekeyright;
    values.responsekeyPleasant_label = parameters.responsekeyright_label;
]
/ blocks = [
    1 = baseline;
    2 = test;
    3 = demographics;
    4 = finish;
]
/
/ subjects = (1 of 2)
/ groupassignment = groupnumber

</expt>

// demographics first
<expt >
/ onexptbegin = [
    values.responsekeyUnpleasant = parameters.responsekeyleft;
    values.responsekeyUnpleasant_label = parameters.responsekeyleft_label;
    values.responsekeyPleasant = parameters.responsekeyright;
    values.responsekeyPleasant_label = parameters.responsekeyright_label;
]
/ blocks = [
    1 = demographics;
    2 = baseline;
    3 = test;
    4 = finish;
]
/
/ subjects = (2 of 2)
/ groupassignment = groupnumber

</expt>

See https://www.millisecond.com/support/docs/v5/html/language/attributes/subjects.htm and https://www.millisecond.com/support/docs/v5/html/language/attributes/groupassignment.htm

Alternatively, if you prefer to have your self-report measures and your priming procedure in separate scripts, you can achieve the same thing by creating a <batch> script with two conditions, running the two scripts in counterbalanced order:

// priming first
<batch>
/ file = "affectivepriming.iqx"
/ file = "selfreport.iqx"
/ subjects = (1 of 2)
/ groupassignment = groupnumber
</batch>

// self-report first
<batch>
/ file = "selfreport.iqx"
/ file = "affectivepriming.iqx"
/ subjects = (2 of 2)
/ groupassignment = groupnumber
</batch>

See https://www.millisecond.com/support/docs/v5/html/language/elements/batch.htm



By babj - 1/30/2020

I tried the first strategy. I specifically first pasted a demographic survey (from the test library) into my affective priming script:

<usermanual>
___________________________________________________________________________________________________________________    

                                    DEMOGRAPHIC SURVEY TEMPLATE
___________________________________________________________________________________________________________________    

Script Author: Katja Borchert, Ph.D. (katjab@millisecond.com) for Millisecond Software, LLC
Date: 12-09-2014
last updated: 11-08-2019 by K. Borchert (katjab@millisecond.com) for Millisecond Software, LLC

Script Copyright © 11-08-2019 Millisecond Software

___________________________________________________________________________________________________________________
BACKGROUND INFO     
___________________________________________________________________________________________________________________
This script implements a template for a Demographic Survey in the US.

___________________________________________________________________________________________________________________    
DATA FILE INFORMATION
___________________________________________________________________________________________________________________
The default data stored in the data files are:

(1) Raw datafile: 'demographics.iqdat' (a separate file for each participant)

date, time:                        date and time script was run with the current group/subjectnumber
subject, group, session:              with the current subject/groupnumber/session id
build:                            the Inquisit build

q*_response:                        response given (in assigned values)
q*_latency:                        how much time (in ms) the participant spent on the surveypage with this particular question (the last time this particular surveypage was visited)


(2) Summary data file: 'demographics_summary*.iqdat' (a separate file for each participant)

computer.platform:                the platform the script was run on (win/mac/ios/android)
script.startdate:                    date script was run
script.starttime:                    time script was started
script.subjectid:                    assigned subject id number
script.groupid:                    assigned group id number
script.sessionid:                    assigned session id number
script.elapsedtime:                time it took to run script (in ms); measured from onset to offset of script
script.completed:                    0 = script was not completed (prematurely aborted);
                                1 = script was completed (all conditions run)

___________________________________________________________________________________________________________________
QUESTIONNAIRE SET-UP
___________________________________________________________________________________________________________________    

The template provides questions for:
- age
- gender
- ethnicity
- raceorigin
- education
- employmentstatus
- marital status
- household members
- household income
- region

All individual questions can be edited under section "QUESTIONS"
All surveypage elements can be edited under section "SURVEYPAGES"
The survey can be edited under section "SURVEY"

___________________________________________________________________________________________________________________    
EDITABLE CODE
___________________________________________________________________________________________________________________    
check below for (relatively) easily editable parameters, stimuli, instructions etc.
Keep in mind that you can use this script as a template and therefore always "mess" with the entire code
to further customize your experiment.

The parameters you can change are:

/pageinstructions:            the instructions that appear at the top of each surveypage

/quitinstructions:            the instructions to quit the questionnaire
                                Note: the quitcommand can be changed under DEFAULTS

</usermanual>


**************************************************************************************************************
**************************************************************************************************************
    EDITABLE PARAMETERS: change editable parameters here
**************************************************************************************************************
**************************************************************************************************************

<parameters>
/demographicpageinstructions = "Please select the answers that apply best.
"
/quitinstructions = "To quit the questionnaire at any time, press Alt+E
"
</parameters>


**************************************************************************************************************
                                !!!REMAINING CODE: Customize after careful consideration only!!!
**************************************************************************************************************


**************************************************************************************************************
**************************************************************************************************************
    DEFAULTS
**************************************************************************************************************
**************************************************************************************************************
script requires Inquisit 6.0.0.0 or higher

<defaults>
/canvasaspectratio = (4,3)
/minimumversion = "6.0.0.0"
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/txbgcolor = white
/ txcolor = black

/ quitcommand = (Alt+18)
</defaults>


*******************************************************************************************************************
*******************************************************************************************************************
    DATA: this section contains data file information
*******************************************************************************************************************
*******************************************************************************************************************

********************
raw data: Demographics.iqdat
********************

********************
Summary data
********************

<summarydata>
/columns = (computer.platform,script.startdate, script.starttime, script.subjectid, script.groupid, script.sessionid, script.elapsedtime,
script.completed)
</summarydata>

*******************************************************************************************************************
*******************************************************************************************************************
    VALUES: automatically updated
*******************************************************************************************************************
*******************************************************************************************************************


*******************************************************************************************************************
*******************************************************************************************************************
    QUESTIONS
*******************************************************************************************************************
*******************************************************************************************************************
Note: by default all questions are required to be answered. To change, set
/required = false

<radiobuttons gender>
/caption = "What is your gender?"
/ options = ("Female",
"Male",
"I prefer not to answer this question")
/other = "Other (please specify):"
/required = true
/orientation = vertical
</radiobuttons>

<dropdown age>
/caption = "What is your age?"
/options = (
"Under 12 years old",
"12-17 years old",
"18-24 years old",
"25-34 years old",
"35-44 years old",
"45-54 years old",
"55-64 years old",
"65-74 years old",
"75 years or older"
"I prefer not to answer this question")
/required = true
</dropdown>

<radiobuttons ethnicity>
/caption = "What is your ethnicity?"
/ options = ("Hispanic or Latino (a person of Cuban, Mexican, Puerto Rican, Cuban, South or Central American, or other Spanish culture or origin, regardless of race",
"Not Hispanic or Latino",
"I prefer not to answer this question")
/required = true
/orientation = vertical
</radiobuttons>

<checkboxes raceorigin>
/ caption="What is your race? Mark one or more races to indicate what you consider yourself to be."
/ required = true
/ options=("American Indian or Alaska Native (a person having origins in any of the original peoples of North and South America (including Central America) who maintains cultural identification through tribal affiliation or community attachment)",
"Asian (a person having origins in any of the original peoples of the Far East, Southeast Asia, or the Indian Subcontinent, including, for example, Cambodia, China, India, Japan, Korea, Malaysia, Pakistan, the Philippine Islands, Thailand, and Vietnam)",
"Black or African American (a person having origins in any of the black racial groups of Africa)",
"Native Hawaiian or Other Pacific Islander (a person having origins in any of the original peoples of Hawaii, Guam, Samoa, or other Pacific Islands)",
"White (a person having origins in any of the original peoples of Europe, the Middle East, or North Africa)",
"I prefer not to answer this question")
/orientation = vertical
/other = "Info you would like to add:"
/required = true
</checkboxes>


<radiobuttons education>
/caption = "What is the highest degree or level of schooling you have completed? If currently enrolled, highest degree received so far."
/ options = ( 
"Doctoral or professional degree",
"Master's degree",
"Bachelor's degree",
"Associate's degree",
"Postsecondary non-degree award",
"Some college, no degree",
"High school diploma or equivalent",
"Less than high school",
"I prefer not to answer this question")
/other = "Other (please specify):"
/required = true
/orientation = vertical
</radiobuttons>

<radiobuttons employmentstatus>
/caption = "Are you currently…?"
/options = (
"Employed for wages",
"Self-employed",
"Out of work and looking for work",
"Out of work but not currently looking for work",
"A homemaker",
"A student",
"Military",
"Retired",
"Unable to work",
"I prefer not to answer this question")
/other = "Other (please specify):"
/required = true
</radiobuttons>

<radiobuttons maritalstatus>
/caption = "What is your marital status?"
/options = (
"Single, never married",
"Married or domestic partnership",
"Widowed",
"Divorced",
"Separated",
"I prefer not to answer this question")
/other = "Other (please specify)"
/required = true
/orientation = vertical
</radiobuttons>

<dropdown householdmembers>
/caption = "How many people live in your household?"
/options = (
"One person",
"Two people",
"Three people",
"Four people",
"Five people",
"Six or more people",
"I prefer not to answer this question")
/required = true
</dropdown>


<dropdown householdincome>
/caption = "What was your total household income before taxes during the past 12 months?"
/options = (
"Less than $25,000",
"$25,000 to $34,999",
"$35,000 to $49,999",
"$50,000 to $74,999",
"$75,000 to $99,999",
"$100,000 to $149,999",
"$150,000 to $199,999",
"$200,000 or more",
"I prefer not to answer this question")
/required = true
</dropdown>

<radiobuttons region>
/caption = "Which region of the United States do you currently live in?"
/options = (
"Midwest - IA, IL, IN, KS, MI, MN, MO, ND, NE, OH, SD, WI",
"Northeast - CT, DC, DE, MA, MD, ME, NH, NJ, NY, PA, RI, VT",
"Southeast - AL, AR, FL, GA, KY, LA, MS, NC, SC, TN, VA, WV",
"Southwest - AZ, NM, OK, TX",
"West - AK, CA, CO, HI, ID, MT, NV, OR, UT, WA, WY",
"I prefer not to answer this question")
/other = "I live outside the United States (please specify)"
/required = true
</radiobuttons>

The nine U.S. Census Divisions are groups of states as defined below:

"New England (Maine, New Hampshire, Vermont, Massachusetts, Rhode Island, Connecticut",
"Middle Atlantic (New York, New Jersey, Pennsylvania)",
"East North Central (Ohio, Indiana, Illinois, Michigan, Wisconsin)",
"West North Central (Minnesota, Iowa, Missouri, North Dakota, South Dakota, Nebraska, Kansas)",
"South Atlantic (Delaware, Maryland, District of Columbia, Virginia, West Virginia, North Carolina, South Carolina, Georgia, Florida)",
"East South Central (Kentucky, Tennessee, Alabama, Mississippi)",
"West South Central (Arkansas, Louisiana, Oklahoma, Texas)",
"Mountain (Montana, Idaho, Wyoming, Colorado, New Mexico, Arizona, Utah, Nevada)",
"Pacific (Washington, Oregon, California, Alaska, Hawaii)",
"I prefer not to answer this question")

*******************************************************************************************************************
*******************************************************************************************************************
    SURVEYPAGES
*******************************************************************************************************************
*******************************************************************************************************************
<surveypage Demographics1>
/caption ="<%parameters.demographicpageinstructions%>"
/subcaption = "<%parameters.quitinstructions%>"
/questions = [1 = gender, age, ethnicity]
</surveypage>

<surveypage Demographics2>
/caption ="<%parameters.demographicpageinstructions%>"
/subcaption = "<%parameters.quitinstructions%>"
/questions = [1 = raceorigin]
</surveypage>

<surveypage Demographics3>
/caption ="<%parameters.demographicpageinstructions%>"
/subcaption = "<%parameters.quitinstructions%>"
/questions = [1 = education]
</surveypage>

<surveypage Demographics4>
/caption ="<%parameters.demographicpageinstructions%>"
/subcaption = "<%parameters.quitinstructions%>"
/questions = [1 = employmentstatus]
</surveypage>

<surveypage Demographics5>
/caption ="<%parameters.demographicpageinstructions%>"
/subcaption = "<%parameters.quitinstructions%>"
/questions = [1 = maritalstatus, householdmembers]
</surveypage>

<surveypage Demographics6>
/caption ="<%parameters.demographicpageinstructions%>"
/subcaption = "<%parameters.quitinstructions%>"
/questions = [1 = householdincome]
</surveypage>

<surveypage Demographics7>
/caption ="<%parameters.demographicpageinstructions%>"
/subcaption = "<%parameters.quitinstructions%>"
/questions = [1 = region]
</surveypage>

*******************************************************************************************************************
*******************************************************************************************************************
    SURVEY
*******************************************************************************************************************
*******************************************************************************************************************
Notes:
- presents the surveypages

<survey Demographics>
/pages = [
    1 = Demographics1;
    2 = Demographics2;
    3 = Demographics3;
    4 = Demographics4;
    5 = Demographics5;
    6 = Demographics6;
    7 = Demographics7;
]
/showpagenumbers = false
/showquestionnumbers = false
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/subcaptionfontstyle = ("Arial", 1.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/ navigationbuttonfontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/ navigationbuttonsize = (15%, 5%)
/ backbuttonposition = (20%, 90%)
/ nextbuttonposition = (70%, 90%)
/ finishlabel = "Finish"
</survey>

*******************************************************************************************************************
                                                End of File
*******************************************************************************************************************



I then pasted this code you suggested and updated "demographics" to "Demographics":

// priming first
<expt >
/ onexptbegin = [
  values.responsekeyUnpleasant = parameters.responsekeyleft;
  values.responsekeyUnpleasant_label = parameters.responsekeyleft_label;
  values.responsekeyPleasant = parameters.responsekeyright;
  values.responsekeyPleasant_label = parameters.responsekeyright_label;
]
/ blocks = [
  1 = baseline;
  2 = test;
  3 = Demographics;
  4 = finish;
]
/
/ subjects = (1 of 2)
/ groupassignment = groupnumber
</expt>

// demographics first
<expt >
/ onexptbegin = [
  values.responsekeyUnpleasant = parameters.responsekeyleft;
  values.responsekeyUnpleasant_label = parameters.responsekeyleft_label;
  values.responsekeyPleasant = parameters.responsekeyright;
  values.responsekeyPleasant_label = parameters.responsekeyright_label;
]
/ blocks = [
  1 = Demographics;
  2 = baseline;
  3 = test;
  4 = finish;
]
/
/ subjects = (2 of 2)
/ groupassignment = groupnumber
</expt>

Where did I go wrong?
By Dave - 1/30/2020

babj - 1/30/2020
I tried the first strategy. I specifically first pasted a demographic survey (from the test library) into my affective priming script:

<usermanual>
___________________________________________________________________________________________________________________    

                                    DEMOGRAPHIC SURVEY TEMPLATE
___________________________________________________________________________________________________________________    

Script Author: Katja Borchert, Ph.D. (katjab@millisecond.com) for Millisecond Software, LLC
Date: 12-09-2014
last updated: 11-08-2019 by K. Borchert (katjab@millisecond.com) for Millisecond Software, LLC

Script Copyright © 11-08-2019 Millisecond Software

___________________________________________________________________________________________________________________
BACKGROUND INFO     
___________________________________________________________________________________________________________________
This script implements a template for a Demographic Survey in the US.

___________________________________________________________________________________________________________________    
DATA FILE INFORMATION
___________________________________________________________________________________________________________________
The default data stored in the data files are:

(1) Raw datafile: 'demographics.iqdat' (a separate file for each participant)

date, time:                        date and time script was run with the current group/subjectnumber
subject, group, session:              with the current subject/groupnumber/session id
build:                            the Inquisit build

q*_response:                        response given (in assigned values)
q*_latency:                        how much time (in ms) the participant spent on the surveypage with this particular question (the last time this particular surveypage was visited)


(2) Summary data file: 'demographics_summary*.iqdat' (a separate file for each participant)

computer.platform:                the platform the script was run on (win/mac/ios/android)
script.startdate:                    date script was run
script.starttime:                    time script was started
script.subjectid:                    assigned subject id number
script.groupid:                    assigned group id number
script.sessionid:                    assigned session id number
script.elapsedtime:                time it took to run script (in ms); measured from onset to offset of script
script.completed:                    0 = script was not completed (prematurely aborted);
                                1 = script was completed (all conditions run)

___________________________________________________________________________________________________________________
QUESTIONNAIRE SET-UP
___________________________________________________________________________________________________________________    

The template provides questions for:
- age
- gender
- ethnicity
- raceorigin
- education
- employmentstatus
- marital status
- household members
- household income
- region

All individual questions can be edited under section "QUESTIONS"
All surveypage elements can be edited under section "SURVEYPAGES"
The survey can be edited under section "SURVEY"

___________________________________________________________________________________________________________________    
EDITABLE CODE
___________________________________________________________________________________________________________________    
check below for (relatively) easily editable parameters, stimuli, instructions etc.
Keep in mind that you can use this script as a template and therefore always "mess" with the entire code
to further customize your experiment.

The parameters you can change are:

/pageinstructions:            the instructions that appear at the top of each surveypage

/quitinstructions:            the instructions to quit the questionnaire
                                Note: the quitcommand can be changed under DEFAULTS

</usermanual>


**************************************************************************************************************
**************************************************************************************************************
    EDITABLE PARAMETERS: change editable parameters here
**************************************************************************************************************
**************************************************************************************************************

<parameters>
/demographicpageinstructions = "Please select the answers that apply best.
"
/quitinstructions = "To quit the questionnaire at any time, press Alt+E
"
</parameters>


**************************************************************************************************************
                                !!!REMAINING CODE: Customize after careful consideration only!!!
**************************************************************************************************************


**************************************************************************************************************
**************************************************************************************************************
    DEFAULTS
**************************************************************************************************************
**************************************************************************************************************
script requires Inquisit 6.0.0.0 or higher

<defaults>
/canvasaspectratio = (4,3)
/minimumversion = "6.0.0.0"
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/txbgcolor = white
/ txcolor = black

/ quitcommand = (Alt+18)
</defaults>


*******************************************************************************************************************
*******************************************************************************************************************
    DATA: this section contains data file information
*******************************************************************************************************************
*******************************************************************************************************************

********************
raw data: Demographics.iqdat
********************

********************
Summary data
********************

<summarydata>
/columns = (computer.platform,script.startdate, script.starttime, script.subjectid, script.groupid, script.sessionid, script.elapsedtime,
script.completed)
</summarydata>

*******************************************************************************************************************
*******************************************************************************************************************
    VALUES: automatically updated
*******************************************************************************************************************
*******************************************************************************************************************


*******************************************************************************************************************
*******************************************************************************************************************
    QUESTIONS
*******************************************************************************************************************
*******************************************************************************************************************
Note: by default all questions are required to be answered. To change, set
/required = false

<radiobuttons gender>
/caption = "What is your gender?"
/ options = ("Female",
"Male",
"I prefer not to answer this question")
/other = "Other (please specify):"
/required = true
/orientation = vertical
</radiobuttons>

<dropdown age>
/caption = "What is your age?"
/options = (
"Under 12 years old",
"12-17 years old",
"18-24 years old",
"25-34 years old",
"35-44 years old",
"45-54 years old",
"55-64 years old",
"65-74 years old",
"75 years or older"
"I prefer not to answer this question")
/required = true
</dropdown>

<radiobuttons ethnicity>
/caption = "What is your ethnicity?"
/ options = ("Hispanic or Latino (a person of Cuban, Mexican, Puerto Rican, Cuban, South or Central American, or other Spanish culture or origin, regardless of race",
"Not Hispanic or Latino",
"I prefer not to answer this question")
/required = true
/orientation = vertical
</radiobuttons>

<checkboxes raceorigin>
/ caption="What is your race? Mark one or more races to indicate what you consider yourself to be."
/ required = true
/ options=("American Indian or Alaska Native (a person having origins in any of the original peoples of North and South America (including Central America) who maintains cultural identification through tribal affiliation or community attachment)",
"Asian (a person having origins in any of the original peoples of the Far East, Southeast Asia, or the Indian Subcontinent, including, for example, Cambodia, China, India, Japan, Korea, Malaysia, Pakistan, the Philippine Islands, Thailand, and Vietnam)",
"Black or African American (a person having origins in any of the black racial groups of Africa)",
"Native Hawaiian or Other Pacific Islander (a person having origins in any of the original peoples of Hawaii, Guam, Samoa, or other Pacific Islands)",
"White (a person having origins in any of the original peoples of Europe, the Middle East, or North Africa)",
"I prefer not to answer this question")
/orientation = vertical
/other = "Info you would like to add:"
/required = true
</checkboxes>


<radiobuttons education>
/caption = "What is the highest degree or level of schooling you have completed? If currently enrolled, highest degree received so far."
/ options = ( 
"Doctoral or professional degree",
"Master's degree",
"Bachelor's degree",
"Associate's degree",
"Postsecondary non-degree award",
"Some college, no degree",
"High school diploma or equivalent",
"Less than high school",
"I prefer not to answer this question")
/other = "Other (please specify):"
/required = true
/orientation = vertical
</radiobuttons>

<radiobuttons employmentstatus>
/caption = "Are you currently…?"
/options = (
"Employed for wages",
"Self-employed",
"Out of work and looking for work",
"Out of work but not currently looking for work",
"A homemaker",
"A student",
"Military",
"Retired",
"Unable to work",
"I prefer not to answer this question")
/other = "Other (please specify):"
/required = true
</radiobuttons>

<radiobuttons maritalstatus>
/caption = "What is your marital status?"
/options = (
"Single, never married",
"Married or domestic partnership",
"Widowed",
"Divorced",
"Separated",
"I prefer not to answer this question")
/other = "Other (please specify)"
/required = true
/orientation = vertical
</radiobuttons>

<dropdown householdmembers>
/caption = "How many people live in your household?"
/options = (
"One person",
"Two people",
"Three people",
"Four people",
"Five people",
"Six or more people",
"I prefer not to answer this question")
/required = true
</dropdown>


<dropdown householdincome>
/caption = "What was your total household income before taxes during the past 12 months?"
/options = (
"Less than $25,000",
"$25,000 to $34,999",
"$35,000 to $49,999",
"$50,000 to $74,999",
"$75,000 to $99,999",
"$100,000 to $149,999",
"$150,000 to $199,999",
"$200,000 or more",
"I prefer not to answer this question")
/required = true
</dropdown>

<radiobuttons region>
/caption = "Which region of the United States do you currently live in?"
/options = (
"Midwest - IA, IL, IN, KS, MI, MN, MO, ND, NE, OH, SD, WI",
"Northeast - CT, DC, DE, MA, MD, ME, NH, NJ, NY, PA, RI, VT",
"Southeast - AL, AR, FL, GA, KY, LA, MS, NC, SC, TN, VA, WV",
"Southwest - AZ, NM, OK, TX",
"West - AK, CA, CO, HI, ID, MT, NV, OR, UT, WA, WY",
"I prefer not to answer this question")
/other = "I live outside the United States (please specify)"
/required = true
</radiobuttons>

The nine U.S. Census Divisions are groups of states as defined below:

"New England (Maine, New Hampshire, Vermont, Massachusetts, Rhode Island, Connecticut",
"Middle Atlantic (New York, New Jersey, Pennsylvania)",
"East North Central (Ohio, Indiana, Illinois, Michigan, Wisconsin)",
"West North Central (Minnesota, Iowa, Missouri, North Dakota, South Dakota, Nebraska, Kansas)",
"South Atlantic (Delaware, Maryland, District of Columbia, Virginia, West Virginia, North Carolina, South Carolina, Georgia, Florida)",
"East South Central (Kentucky, Tennessee, Alabama, Mississippi)",
"West South Central (Arkansas, Louisiana, Oklahoma, Texas)",
"Mountain (Montana, Idaho, Wyoming, Colorado, New Mexico, Arizona, Utah, Nevada)",
"Pacific (Washington, Oregon, California, Alaska, Hawaii)",
"I prefer not to answer this question")

*******************************************************************************************************************
*******************************************************************************************************************
    SURVEYPAGES
*******************************************************************************************************************
*******************************************************************************************************************
<surveypage Demographics1>
/caption ="<%parameters.demographicpageinstructions%>"
/subcaption = "<%parameters.quitinstructions%>"
/questions = [1 = gender, age, ethnicity]
</surveypage>

<surveypage Demographics2>
/caption ="<%parameters.demographicpageinstructions%>"
/subcaption = "<%parameters.quitinstructions%>"
/questions = [1 = raceorigin]
</surveypage>

<surveypage Demographics3>
/caption ="<%parameters.demographicpageinstructions%>"
/subcaption = "<%parameters.quitinstructions%>"
/questions = [1 = education]
</surveypage>

<surveypage Demographics4>
/caption ="<%parameters.demographicpageinstructions%>"
/subcaption = "<%parameters.quitinstructions%>"
/questions = [1 = employmentstatus]
</surveypage>

<surveypage Demographics5>
/caption ="<%parameters.demographicpageinstructions%>"
/subcaption = "<%parameters.quitinstructions%>"
/questions = [1 = maritalstatus, householdmembers]
</surveypage>

<surveypage Demographics6>
/caption ="<%parameters.demographicpageinstructions%>"
/subcaption = "<%parameters.quitinstructions%>"
/questions = [1 = householdincome]
</surveypage>

<surveypage Demographics7>
/caption ="<%parameters.demographicpageinstructions%>"
/subcaption = "<%parameters.quitinstructions%>"
/questions = [1 = region]
</surveypage>

*******************************************************************************************************************
*******************************************************************************************************************
    SURVEY
*******************************************************************************************************************
*******************************************************************************************************************
Notes:
- presents the surveypages

<survey Demographics>
/pages = [
    1 = Demographics1;
    2 = Demographics2;
    3 = Demographics3;
    4 = Demographics4;
    5 = Demographics5;
    6 = Demographics6;
    7 = Demographics7;
]
/showpagenumbers = false
/showquestionnumbers = false
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/subcaptionfontstyle = ("Arial", 1.5%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/ navigationbuttonfontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/ navigationbuttonsize = (15%, 5%)
/ backbuttonposition = (20%, 90%)
/ nextbuttonposition = (70%, 90%)
/ finishlabel = "Finish"
</survey>

*******************************************************************************************************************
                                                End of File
*******************************************************************************************************************



I then pasted this code you suggested and updated "demographics" to "Demographics":

// priming first
<expt >
/ onexptbegin = [
  values.responsekeyUnpleasant = parameters.responsekeyleft;
  values.responsekeyUnpleasant_label = parameters.responsekeyleft_label;
  values.responsekeyPleasant = parameters.responsekeyright;
  values.responsekeyPleasant_label = parameters.responsekeyright_label;
]
/ blocks = [
  1 = baseline;
  2 = test;
  3 = Demographics;
  4 = finish;
]
/
/ subjects = (1 of 2)
/ groupassignment = groupnumber
</expt>

// demographics first
<expt >
/ onexptbegin = [
  values.responsekeyUnpleasant = parameters.responsekeyleft;
  values.responsekeyUnpleasant_label = parameters.responsekeyleft_label;
  values.responsekeyPleasant = parameters.responsekeyright;
  values.responsekeyPleasant_label = parameters.responsekeyright_label;
]
/ blocks = [
  1 = Demographics;
  2 = baseline;
  3 = test;
  4 = finish;
]
/
/ subjects = (2 of 2)
/ groupassignment = groupnumber
</expt>

Where did I go wrong?

Instead of posting snippets of code, please attach the actual script. Further, I cannot answer where you went wrong if you don't explain what actually doesn't work.
By babj - 1/30/2020

Code is attached. It is my attempt to combine an affective priming script (that you provided earlier in the thread) with a demographics survey from the test library so that they go in the same script.
By Dave - 1/30/2020

babj - 1/30/2020
Code is attached. It is my attempt to combine an affective priming script (that you provided earlier in the thread) with a demographics survey from the test library so that they go in the same script.

See attached.