Script for trial interval


Author
Message
daphne golden
daphne golden
Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)
Group: Awaiting Activation
Posts: 13, Visits: 475
Hi, I am trying to write a script that allows for the following:
1) An inter-trial interval of 1500ms
2) A target is presented until a) you respond or b) for a maximum of 3000ms.

I am able to set the trial time (target to cue) and inter trial time (cue to target).  This does not allow for a shortened trial time when one responses before the 3000ms maximum.

Any help would be appreciated. Thanks Daphne


Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 108K
Since you have not provided any of your code, I cannot answer specifically. In general, though, see the "How to Control Trial Duration and Inter-Trial Intervals" topic in the documentation. The attributes of interest are /pre- or /posttrialpause for the ITI, and either /timeout or / response = timeout(milliseconds) for the max response window duration.

daphne golden
daphne golden
Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)
Group: Awaiting Activation
Posts: 13, Visits: 475
Here is my script. I have tried multiple things, however, I still can not get this to work.

The only time I am able to get a pretrialpause, I get the message "wrong response" rather than the message "too slow".
Experiment-
correct- if correct response
wrong answer- if incorrect response
too slow-if the response is longer than 3500
too early- if the response is longer than 200



<values>
/flankerheight = 7%
/spacingfactor = 2.25
/increaseboxfactor = 3.23
/pretrialpause = 1500
/responsekey1 = 16
/responsekey2 = 25
/target_increase = 0%
/target_decrease = 0%
/feedback_positive = 1
/feedback_experiment = 0
/SOA_targetcue = 3500
/fixed_SOA_cuetarget = 1500
/regular_restperiod = 10000
/feedback_duration = 500
</values>

***************************************************************************************
*********************************************
Editable Stimuli
*********************************************
***************************************************************************************
<item arrows>
/1 = "R_fish.png"
/2 = "L_fish.png"
</item>
Alternatives:
/1 = ">"
/2 = "<"

<item feedback>
/1 = "Correct"
/2 = "Wrong Response"
</item>

***************************************************************************************
*********************************************
Editable Instructions
*********************************************
***************************************************************************************
Note: if any of the default values have changed, check whether the instructions
need editing as well.

<instruct>
/windowsize = (90%, 90%)
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/ txcolor = (0, 0, 0)
/ finishlabel = "<SPACEBAR>"
/ lastlabel = "<SPACEBAR> to start"
/nextkey = (57)
/ lastlabel = "<SPACEBAR> to continue"
/prevkey = (28)
/prevlabel = "<ENTER> to go back"
</instruct>


<page intro>
Welcome! This is an experiment to study attention.

^^^^In this experiment you will see five arrows inside a box. Your task is to decide if the CENTER arrow points LEFT or RIGHT.
^^*Sometimes all five arrows point in the same direction, 
^*Sometimes the CENTER arrow points in a different direction than the rest.
^*Sometimes the CENTER arrow is SMALLER,
^*Sometimes the CENTER arrow is BIGGER than the other arrows.
^^Before the five arrows appear, you will first see an empty box in the middle of the screen. This is your cue that soon the arrows will
appear inside the box.

^^^^IMPORTANT: Pay close attention to the instructions that will tell you which buttons to press if the CENTER arrow points LEFT or RIGHT. These instructions
can change.


^^^^Continue to some practice.
</page>

<page practice_compatible>
This is PRACTICE.

^^^^Remember your task is to decide if the CENTER arrow points LEFT or RIGHT. 
^^* If the CENTER arrow points LEFT, press the "Q" key on your keyboard.
^^* If the CENTER arrow points RIGHT, press the "P" key on your keyboard.

^^^^Try to be as fast as you can while making as few mistakes as you can.
^^The computer will tell you if you made a mistake during practice.

^^^^If you are ready, press the <SPACEBAR> to start.
</page>

<page practice_incompatible>
This is PRACTICE.

^^^^Remember your task is to decide if the CENTER arrow points LEFT or RIGHT. 
^^* If the CENTER arrow points LEFT, press the "P" key on your keyboard.
^^* If the CENTER arrow points RIGHT, press the "Q" key on your keyboard.

^^^^Try to be as fast as you can while making as few mistakes as you can.
^^The computer will tell you if you made a mistake during practice.

^^^^If you are ready, press the <SPACEBAR> to start.

</page>

<page practiceend>
Practice is over. The real experiment is about to start.
^^^^Just like for practice, pay close attention to the instructions that tell you which keys to press if 
the CENTER arrow points right or left.
^^^^Try to be as fast as you can while making as few mistakes as you can.
^The computer will NOT tell you anymore if you made a mistake.
^^^^Press the <SPACEBAR> to continue.
</page>

<page compatible>
^^^^Remember your task is to decide if the CENTER arrow points LEFT or RIGHT. 
^^* If the CENTER arrow points LEFT, press the "Q" key on your keyboard.
^^* If the CENTER arrow points RIGHT, press the "P" key on your keyboard.

^^^^Try to be as fast as you can while making as few mistakes as you can.

^^^^If you are ready, press the <SPACEBAR> to start.
</page>

<page incompatible>
^^^^Remember your task is to decide if the CENTER arrow points LEFT or RIGHT. 
^^* If the CENTER arrow points LEFT, press the "Q" key on your keyboard.
^^* If the CENTER arrow points RIGHT, press the "P" key on your keyboard.

^^^^Try to be as fast as you can while making as few mistakes as you can.

^^^^If you are ready, press the <SPACEBAR> to start.
</page>

<page end>
Thank you for your participation!
</page>


***************************************************************************************
*********************************************
*******************************************************************************************************************
*******************************************************************************************************************
DEFAULTS
*******************************************************************************************************************
*******************************************************************************************************************
requires Inquisit 4.0.2.0

<defaults>
/minimumversion = "4.0.2.0"
/ fontstyle = ("Arial", 4%, false, false, false, false, 5, 1)
/ txcolor = (0, 0, 0)
</defaults>

*******************************************************************************************************************
*******************************************************************************************************************
VALUES
*******************************************************************************************************************
*******************************************************************************************************************

<values>
/blockcount = 0

/currenttargetheight = 0
/box_height = values.flankerheight + values.increaseboxfactor
/box_width = values.box_height * values.spacingfactor

/selecttarget = 0
/selectflanker = 0
/selectfeedback = 0
/responsekey_left = 0
/responsekey_right = 0
/congruence = 0
/fixed = 0
/SOA_cuetarget = 0
/cleanuptime = 0
/restperiod = 0
/practice = 0
/pretrialpause = 0
/correct = 0
/correct_small_congruent = 0
/correct_small_incongruent = 0

/RTsum_small_congruent = 0
/RTsum_small_incongruent = 0
</values>

*******************************************************************************************************************
*******************************************************************************************************************
EXPRESSIONS


<expressions>

/meanrt_small = (values.rtsum_small_congruent + values.rtsum_small_incongruent)/(values.correct_small_congruent + values.correct_small_incongruent)
/meanrt_small_congruent = values.rtsum_small_congruent/values.correct_small_congruent
/meanrt_small_incongruent = values.rtsum_small_incongruent/values.correct_small_incongruent

</expressions>

*******************************************************************************************************************
*******************************************************************************************************************
DATA

<data>
/file = "ArrowFlankerTest_rawdata.iqdat"
/separatefiles = true
/columns = [build, date, time, subject, blockcode, values.blockcount, trialcode, trialnum, values.targetsize, values.congruence, 
values.selecttarget, values.selectflanker, response, correct, latency, 
values.correct_small_congruent, values.correct_small_incongruent,
values.rtsum_small_congruent, values.rtsum_small_incongruent,
expressions.meanrt_small_congruent, expressions.meanrt_small_incongruent]
</data>

********************
summary data
********************
<summarydata >
/file = "ArrowFlankerTest_summary.iqdat"
/columns = [script.startdate, script.starttime, script.subjectid, values.blockcount, values.correct_small_congruent, values.correct_small_incongruent, values.rtsum_small_congruent, values.rtsum_small_incongruent, expressions.meanrt_small_congruent, expressions.meanrt_small_incongruent]
</summarydata>

*******************************************************************************************************************
*******************************************************************************************************************
STIMULI
<shape outerbox>
/shape = rectangle
/height= values.box_height + 2%
/width = values.box_width + 2%
/position = (50%, 50%)
/color = (white)
/erase = false
</shape>

<shape innerbox>
/shape = rectangle
/height = values.box_height
/width = values.box_width
/position = (50%, 50%)
/color = (white)
/erase = false
</shape>

**********************************
Target and Flanker
**********************************

<picture target>
/items = arrows
/select = values.selecttarget
/position = (50%, 50%)
/size = (12%, 12%)
</picture>

<picture flanker1>
/items = arrows
/select = values.selectflanker
/position = (30%, 50%)
/size = (12%, 12%)
</picture>

<picture flanker2>
/items = arrows
/select = values.selectflanker
/position = (40%, 50%)
/size = (12%, 12%)
</picture>

<picture flanker3>
/items = arrows
/select = values.selectflanker
/position = (60%, 50%)
/size = (12%,12%)
</picture>

<picture flanker4>
/items = arrows
/select = values.selectflanker
/position = (70%, 50%)
/size = (12%,12%)

</picture>

********************************
Miscelleneous Stimuli
********************************
<shape eraser>
/shape = rectangle
/position = (50%, 50%)
/size = (100%, 100%)
/color = white
</shape>

<text resttext>
/items = ("Take a break")
/position = (50%, 50%)
</text>

<clock restclock>
/ mode = timer
/ txcolor = yellow
/ txbgcolor = black
/ timeout = values.restperiod
/ position = (50%, 60%)
/ format = "mm:ss"
</clock>

<text feedback>
/items = feedback
/select = values.selectfeedback
/position = (50%, 50%)
/ fontstyle = ("Arial", 4%, false, false, false, false, 5, 1)
/ txcolor = (0, 0, 0)
</text>

<text tooearlymsg>
/items= ("Early Response")
/position= (50%, 50%)
</text>

<text tooslowmsg>
/items= ("Too slow")
/position= (50%, 50%)
</text>

*******************************************************************************************************************
*******************************************************************************************************************
LISTS
*******************************************************************************************************************
*******************************************************************************************************************
<list congruence_smalltarget_left>
/items = (1, 2, 1, 2, 1, 2, 1, 2, 1, 2)
/replace = false
</list>


<list randomselection>
/items =(1, 2)
/replace = true
/ selectionrate = always
</list>

*******************************************************************************************************************
*******************************************************************************************************************
TRIALS
**
Target points to the left
********************************


<trial targetleft_cue>
/stimulusframes = [1 = outerbox, innerbox]
/trialduration = values.SOA_cuetarget
/branch = [trial.targetleft]
/recorddata = false
</trial>

<trial pretrialpause left>
/ stimulusframes=[1=outerbox, innerbox]
/ pretrialpause=500
/timeout = 500
</trial>


<trial targetleft>
/ontrialbegin = [values.selecttarget = 2]
/ontrialbegin = [if (values.congruence == 1) values.selectflanker = values.selecttarget
               else values.selectflanker = 1]
/stimulusframes = [1 = outerbox, innerbox, flanker1, flanker2, target, flanker3, flanker4]
/isvalidresponse = [trial.targetleft.response == values.responsekey_left || trial.targetleft.response == values.responsekey_right]
/iscorrectresponse = [trial.targetleft.response == values.responsekey_left]
/ontrialend = [if (trial.targetleft.correct) values.correct = 1 else values.correct = 0]
/monkeyresponse = (16, 25)
/responseinterrupt = immediate


/ontrialend = [if (trial.targetleft.correct && values.congruence == 1)
                  {values.correct_small_congruent +=1;
                  values.rtsum_small_congruent += trial.targetleft.latency}]
/ontrialend = [if (trial.targetleft.correct && values.congruence == 2)
                  {values.correct_small_incongruent +=1;
                  values.rtsum_small_incongruent += trial.targetleft.latency}]


/timeout = 3500
/branch = [if(trial.targetleft.latency <200) trial.tooearly]
/branch = [if(trial.targetleft.latency > 3499) trial.tooslow]
/branch = [if (values.practice == 1 && values.feedback_positive == 1) trial.feedback]
/branch = [if (values.practice == 1 && values.feedback_positive == 0 && values.correct == 0) trial.feedback]
/branch = [if (values.practice == 1 && values.feedback_positive == 0 && values.correct == 1) trial.cleanup]

/branch = [if (values.feedback_experiment == 0) trial.cleanup]
/branch = [if (values.feedback_experiment == 1 && values.feedback_positive == 1) trial.feedback]
/branch = [if (values.feedback_experiment == 1 && values.feedback_positive == 0 && values.correct ==0) trial.feedback] 
/branch = [if (values.feedback_experiment == 1 && values.feedback_positive == 0 && values.correct ==1) trial.cleanup] 

/recorddata = true
</trial>


********************************
Target points to the right
********************************
see explanations for trials in the left sequence



<trial targetright>

/ontrialbegin = [values.selecttarget = 1]
/ontrialbegin = [if (values.congruence == 1) values.selectflanker = values.selecttarget
               else values.selectflanker = 2]

/stimulusframes = [1 = outerbox, innerbox, flanker1, flanker2, target, flanker3, flanker4]
/isvalidresponse = [trial.targetright.response == values.responsekey_left || trial.targetright.response == values.responsekey_right]
/iscorrectresponse = [trial.targetright.response == values.responsekey_right]
/ontrialend = [if (trial.targetright.correct) values.correct = 1 else values.correct = 0]
/monkeyresponse = (16, 25)
/responseinterrupt = immediate

/ontrialend = [if (trial.targetright.correct && values.congruence == 1)
                  {values.correct_small_congruent +=1;
                  values.rtsum_small_congruent += trial.targetright.latency}]
/ontrialend = [if (trial.targetright.correct && values.congruence == 2)
                  {values.correct_small_incongruent +=1;
                  values.rtsum_small_incongruent += trial.targetright.latency}]
/timeout = 3500
/branch = [if(trial.targetright.latency <200) trial.tooearly]
/branch = [if(trial.targetright.latency > 3499) trial.tooslow]
/branch = [if (values.practice == 1 && values.feedback_positive == 1) trial.feedback]
/branch = [if (values.practice == 1 && values.feedback_positive == 0 && values.correct == 0) trial.feedback]
/branch = [if (values.practice == 1 && values.feedback_positive == 0 && values.correct == 1) trial.cleanup]

/branch = [if (values.feedback_experiment == 0) trial.cleanup]
/branch = [if (values.feedback_experiment == 1 && values.feedback_positive == 1) trial.feedback]
/branch = [if (values.feedback_experiment == 1 && values.feedback_positive == 0 && values.correct ==0) trial.feedback] 
/branch = [if (values.feedback_experiment == 1 && values.feedback_positive == 0 && values.correct ==1) trial.cleanup] 
/recorddata = true
</trial>

<trial tooearly>
/stimulusframes = [1=tooearlymsg]
/trialduration = 500
</trial> 

<trial tooslow>
/stimulusframes = [1=tooslowmsg]
/trialduration = 500
</trial>

***********************************
all trial sequences
***********************************
<trial cleanup>
/stimulusframes = [1 = eraser]
/trialduration = values.cleanuptime
/recorddata = false
</trial>

<trial rest>
/stimulusframes = [1 = resttext, restclock]
/trialduration = values.restperiod
/recorddata = false
</trial>

<trial pretrialpauseright>
/ stimulusframes=[1= outerbox, innerbox]
/ pretrialpause=500
</trial>

<trial feedback>
/ontrialbegin = [if (values.correct == 1) {text.feedback.textcolor = green; values.selectfeedback = 1}
            else {text.feedback.textcolor = red; values.selectfeedback = 2}]
/stimulusframes = [1 = eraser, feedback]
/branch = [trial.cleanup]
/recorddata = false
/trialduration = values.feedback_duration
</trial>

<trial soundfeedback>
/ontrialbegin = [if (values.correct == 1) {text.soundfeedback; values.selectfeedback = 1}
            else {text.soundfeedback; values.selectfeedback = 2}]
/stimulusframes = [1 = eraser, feedback]
/branch = [trial.cleanup]
/recorddata = false
/trialduration = values.feedback_duration
</trial>

*******************************************************************************************************************
*******************************************************************************************************************
BLOCKS
*******************************************************************************************************************

<block practice_compatible_fixed>
/preinstructions = (practice_compatible)
/onblockbegin = [values.practice = 1]
/onblockbegin = [values.blockcount += 1]
/onblockbegin = [values.fixed = 1]
/onblockbegin = [values.responsekey_left = values.responsekey1; values.responsekey_right = values.responsekey2]
/trials = [1-20= noreplace(targetleft, targetright)]

/onblockend = [reset(list.congruence_smalltarget_left)]
/branch = [block.rest]
</block>


<block compatible_fixed>
/preinstructions = (compatible)
/onblockbegin = [values.practice = 0]
/onblockbegin = [values.blockcount += 1]
/onblockbegin = [values.fixed = 1]
/onblockbegin = [values.responsekey_left = values.responsekey1; values.responsekey_right = values.responsekey2]
/trials = [1-20 = noreplace(targetleft, targetright)]

/onblockend = [reset(list.congruence_smalltarget_left)]
/branch = [block.rest]
</block>

*************************
Helper Blocks
**************************

Resets relevant values after practice
<block resetvalues>
/preinstructions = (practiceend)
/onblockbegin = [values.blockcount = 0]
/onblockbegin = [values.correct_small_congruent; values.correct_small_incongruent = 0]
/onblockbegin = [values.rtsum_small_congruent; values.rtsum_small_incongruent = 0]
</block>

<block rest>
/onblockbegin = [if (values.blockcount == values.restperiod) values.restperiod = values.restperiod
                  else values.restperiod = values.regular_restperiod]
/trials = [1 = rest]
</block>

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

<expt >
/preinstructions = (intro)
/postinstructions = (end)
/blocks = [1-4 = noreplace(practice_compatible_fixed)]
</expt>

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

daphne golden
daphne golden
Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)
Group: Awaiting Activation
Posts: 13, Visits: 475
This one runs. I removed the script that I was wrting to add sound. 


<values>
/flankerheight = 7%
/spacingfactor = 2.25
/increaseboxfactor = 3.23
/pretrialpause = 1500
/responsekey1 = 16
/responsekey2 = 25
/target_increase = 0%
/target_decrease = 0%
/feedback_positive = 1
/feedback_experiment = 0
/SOA_targetcue = 3500
/fixed_SOA_cuetarget = 1500
/regular_restperiod = 10000
/feedback_duration = 500
</values>

***************************************************************************************
*********************************************
Editable Stimuli
*********************************************
***************************************************************************************
<item arrows>
/1 = "R_fish.png"
/2 = "L_fish.png"
</item>
Alternatives:
/1 = ">"
/2 = "<"

<item feedback>
/1 = "Correct"
/2 = "Wrong Response"
</item>


***************************************************************************************
*********************************************
Editable Instructions
*********************************************
***************************************************************************************
Note: if any of the default values have changed, check whether the instructions
need editing as well.

<instruct>
/windowsize = (90%, 90%)
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/ txcolor = (0, 0, 0)
/ finishlabel = "<SPACEBAR>"
/ lastlabel = "<SPACEBAR> to start"
/nextkey = (57)
/ lastlabel = "<SPACEBAR> to continue"
/prevkey = (28)
/prevlabel = "<ENTER> to go back"
</instruct>


<page intro>
Welcome! This is an experiment to study attention.

^^^^In this experiment you will see five arrows inside a box. Your task is to decide if the CENTER arrow points LEFT or RIGHT.
^^*Sometimes all five arrows point in the same direction, 
^*Sometimes the CENTER arrow points in a different direction than the rest.
^*Sometimes the CENTER arrow is SMALLER,
^*Sometimes the CENTER arrow is BIGGER than the other arrows.
^^Before the five arrows appear, you will first see an empty box in the middle of the screen. This is your cue that soon the arrows will
appear inside the box.

^^^^IMPORTANT: Pay close attention to the instructions that will tell you which buttons to press if the CENTER arrow points LEFT or RIGHT. These instructions
can change.


^^^^Continue to some practice.
</page>

<page practice_compatible>
This is PRACTICE.

^^^^Remember your task is to decide if the CENTER arrow points LEFT or RIGHT. 
^^* If the CENTER arrow points LEFT, press the "Q" key on your keyboard.
^^* If the CENTER arrow points RIGHT, press the "P" key on your keyboard.

^^^^Try to be as fast as you can while making as few mistakes as you can.
^^The computer will tell you if you made a mistake during practice.

^^^^If you are ready, press the <SPACEBAR> to start.
</page>

<page practice_incompatible>
This is PRACTICE.

^^^^Remember your task is to decide if the CENTER arrow points LEFT or RIGHT. 
^^* If the CENTER arrow points LEFT, press the "P" key on your keyboard.
^^* If the CENTER arrow points RIGHT, press the "Q" key on your keyboard.

^^^^Try to be as fast as you can while making as few mistakes as you can.
^^The computer will tell you if you made a mistake during practice.

^^^^If you are ready, press the <SPACEBAR> to start.

</page>

<page practiceend>
Practice is over. The real experiment is about to start.
^^^^Just like for practice, pay close attention to the instructions that tell you which keys to press if 
the CENTER arrow points right or left.
^^^^Try to be as fast as you can while making as few mistakes as you can.
^The computer will NOT tell you anymore if you made a mistake.
^^^^Press the <SPACEBAR> to continue.
</page>

<page compatible>
^^^^Remember your task is to decide if the CENTER arrow points LEFT or RIGHT. 
^^* If the CENTER arrow points LEFT, press the "Q" key on your keyboard.
^^* If the CENTER arrow points RIGHT, press the "P" key on your keyboard.

^^^^Try to be as fast as you can while making as few mistakes as you can.

^^^^If you are ready, press the <SPACEBAR> to start.
</page>

<page incompatible>
^^^^Remember your task is to decide if the CENTER arrow points LEFT or RIGHT. 
^^* If the CENTER arrow points LEFT, press the "Q" key on your keyboard.
^^* If the CENTER arrow points RIGHT, press the "P" key on your keyboard.

^^^^Try to be as fast as you can while making as few mistakes as you can.

^^^^If you are ready, press the <SPACEBAR> to start.
</page>

<page end>
Thank you for your participation!
</page>


***************************************************************************************
*********************************************
*******************************************************************************************************************
*******************************************************************************************************************
DEFAULTS
*******************************************************************************************************************
*******************************************************************************************************************
requires Inquisit 4.0.2.0

<defaults>
/minimumversion = "4.0.2.0"
/ fontstyle = ("Arial", 4%, false, false, false, false, 5, 1)
/ txcolor = (0, 0, 0)
</defaults>

*******************************************************************************************************************
*******************************************************************************************************************
VALUES
*******************************************************************************************************************
*******************************************************************************************************************

<values>
/blockcount = 0

/currenttargetheight = 0
/box_height = values.flankerheight + values.increaseboxfactor
/box_width = values.box_height * values.spacingfactor

/selecttarget = 0
/selectflanker = 0
/selectfeedback = 0
/responsekey_left = 0
/responsekey_right = 0
/congruence = 0
/fixed = 0
/SOA_cuetarget = 0
/cleanuptime = 0
/restperiod = 0
/practice = 0
/pretrialpause = 0
/correct = 0
/correct_small_congruent = 0
/correct_small_incongruent = 0

/RTsum_small_congruent = 0
/RTsum_small_incongruent = 0
</values>

*******************************************************************************************************************
*******************************************************************************************************************
EXPRESSIONS


<expressions>

/meanrt_small = (values.rtsum_small_congruent + values.rtsum_small_incongruent)/(values.correct_small_congruent + values.correct_small_incongruent)
/meanrt_small_congruent = values.rtsum_small_congruent/values.correct_small_congruent
/meanrt_small_incongruent = values.rtsum_small_incongruent/values.correct_small_incongruent

</expressions>

*******************************************************************************************************************
*******************************************************************************************************************
DATA

<data>
/file = "ArrowFlankerTest_rawdata.iqdat"
/separatefiles = true
/columns = [build, date, time, subject, blockcode, values.blockcount, trialcode, trialnum, values.targetsize, values.congruence, 
values.selecttarget, values.selectflanker, response, correct, latency, 
values.correct_small_congruent, values.correct_small_incongruent,
values.rtsum_small_congruent, values.rtsum_small_incongruent,
expressions.meanrt_small_congruent, expressions.meanrt_small_incongruent]
</data>

********************
summary data
********************
<summarydata >
/file = "ArrowFlankerTest_summary.iqdat"
/columns = [script.startdate, script.starttime, script.subjectid, values.blockcount, values.correct_small_congruent, values.correct_small_incongruent, values.rtsum_small_congruent, values.rtsum_small_incongruent, expressions.meanrt_small_congruent, expressions.meanrt_small_incongruent]
</summarydata>

*******************************************************************************************************************
*******************************************************************************************************************
STIMULI
<shape outerbox>
/shape = rectangle
/height= values.box_height + 2%
/width = values.box_width + 2%
/position = (50%, 50%)
/color = (white)
/erase = false
</shape>

<shape innerbox>
/shape = rectangle
/height = values.box_height
/width = values.box_width
/position = (50%, 50%)
/color = (white)
/erase = false
</shape>

**********************************
Target and Flanker
**********************************

<picture target>
/items = arrows
/select = values.selecttarget
/position = (50%, 50%)
/valign = center
/halign = center
/size = (12%, 12%)
</picture>

<picture flanker1>
/items = arrows
/select = values.selectflanker
/position = (30%, 50%)
/size = (12%, 12%)
</picture>

<picture flanker2>
/items = arrows
/select = values.selectflanker
/position = (40%, 50%)
/size = (12%, 12%)
</picture>

<picture flanker3>
/items = arrows
/select = values.selectflanker
/position = (60%, 50%)
/size = (12%,12%)
</picture>

<picture flanker4>
/items = arrows
/select = values.selectflanker
/position = (70%, 50%)
/size = (12%,12%)

</picture>

********************************
Miscelleneous Stimuli
********************************
<shape eraser>
/shape = rectangle
/position = (50%, 50%)
/size = (100%, 100%)
/color = white
</shape>

<text resttext>
/items = ("Take a break")
/position = (50%, 50%)
</text>

<clock restclock>
/ mode = timer
/ txcolor = yellow
/ txbgcolor = black
/ timeout = values.restperiod
/ position = (50%, 60%)
/ format = "mm:ss"
</clock>

<text feedback>
/items = feedback
/select = values.selectfeedback
/position = (50%, 50%)
/ fontstyle = ("Arial", 4%, false, false, false, false, 5, 1)
/ txcolor = (0, 0, 0)
</text>

<text tooearlymsg>
/items= ("Early Response")
/position= (50%, 50%)
</text>

<text tooslowmsg>
/items= ("Too slow")
/position= (50%, 50%)
</text>

*******************************************************************************************************************
*******************************************************************************************************************
LISTS
*******************************************************************************************************************
*******************************************************************************************************************
<list congruence_smalltarget_left>
/items = (1, 2, 1, 2, 1, 2, 1, 2, 1, 2)
/replace = false
</list>


<list randomselection>
/items =(1, 2)
/replace = true
/ selectionrate = always
</list>

*******************************************************************************************************************
*******************************************************************************************************************
TRIALS
**
Target points to the left
********************************


<trial targetleft_cue>
/stimulusframes = [1 = outerbox, innerbox]
/trialduration = values.SOA_cuetarget
/branch = [trial.targetleft]
/recorddata = false
</trial>

<trial pretrialpause left>
/ stimulusframes=[1=outerbox, innerbox]
/ pretrialpause=500
/timeout = 500
</trial>


<trial targetleft>
/ontrialbegin = [values.selecttarget = 2]
/ontrialbegin = [if (values.congruence == 1) values.selectflanker = values.selecttarget
               else values.selectflanker = 1]
/stimulusframes = [1 = outerbox, innerbox, flanker1, flanker2, target, flanker3, flanker4]
/isvalidresponse = [trial.targetleft.response == values.responsekey_left || trial.targetleft.response == values.responsekey_right]
/iscorrectresponse = [trial.targetleft.response == values.responsekey_left]
/ontrialend = [if (trial.targetleft.correct) values.correct = 1 else values.correct = 0]
/monkeyresponse = (16, 25)
/responseinterrupt = immediate


/ontrialend = [if (trial.targetleft.correct && values.congruence == 1)
                  {values.correct_small_congruent +=1;
                  values.rtsum_small_congruent += trial.targetleft.latency}]
/ontrialend = [if (trial.targetleft.correct && values.congruence == 2)
                  {values.correct_small_incongruent +=1;
                  values.rtsum_small_incongruent += trial.targetleft.latency}]


/timeout = 3500
/branch = [if(trial.targetleft.latency <200) trial.tooearly]
/branch = [if(trial.targetleft.latency > 3499) trial.tooslow]
/branch = [if (values.practice == 1 && values.feedback_positive == 1) trial.feedback]
/branch = [if (values.practice == 1 && values.feedback_positive == 0 && values.correct == 0) trial.feedback]
/branch = [if (values.practice == 1 && values.feedback_positive == 0 && values.correct == 1) trial.cleanup]

/branch = [if (values.feedback_experiment == 0) trial.cleanup]
/branch = [if (values.feedback_experiment == 1 && values.feedback_positive == 1) trial.feedback]
/branch = [if (values.feedback_experiment == 1 && values.feedback_positive == 0 && values.correct ==0) trial.feedback] 
/branch = [if (values.feedback_experiment == 1 && values.feedback_positive == 0 && values.correct ==1) trial.cleanup] 

/recorddata = true
</trial>


********************************
Target points to the right
********************************
see explanations for trials in the left sequence



<trial targetright>

/ontrialbegin = [values.selecttarget = 1]
/ontrialbegin = [if (values.congruence == 1) values.selectflanker = values.selecttarget
               else values.selectflanker = 2]

/stimulusframes = [1 = outerbox, innerbox, flanker1, flanker2, target, flanker3, flanker4]
/isvalidresponse = [trial.targetright.response == values.responsekey_left || trial.targetright.response == values.responsekey_right]
/iscorrectresponse = [trial.targetright.response == values.responsekey_right]
/ontrialend = [if (trial.targetright.correct) values.correct = 1 else values.correct = 0]
/monkeyresponse = (16, 25)
/responseinterrupt = immediate

/ontrialend = [if (trial.targetright.correct && values.congruence == 1)
                  {values.correct_small_congruent +=1;
                  values.rtsum_small_congruent += trial.targetright.latency}]
/ontrialend = [if (trial.targetright.correct && values.congruence == 2)
                  {values.correct_small_incongruent +=1;
                  values.rtsum_small_incongruent += trial.targetright.latency}]
/timeout = 3500
/branch = [if(trial.targetright.latency <200) trial.tooearly]
/branch = [if(trial.targetright.latency > 3499) trial.tooslow]
/branch = [if (values.practice == 1 && values.feedback_positive == 1) trial.feedback]
/branch = [if (values.practice == 1 && values.feedback_positive == 0 && values.correct == 0) trial.feedback]
/branch = [if (values.practice == 1 && values.feedback_positive == 0 && values.correct == 1) trial.cleanup]

/branch = [if (values.feedback_experiment == 0) trial.cleanup]
/branch = [if (values.feedback_experiment == 1 && values.feedback_positive == 1) trial.feedback]
/branch = [if (values.feedback_experiment == 1 && values.feedback_positive == 0 && values.correct ==0) trial.feedback] 
/branch = [if (values.feedback_experiment == 1 && values.feedback_positive == 0 && values.correct ==1) trial.cleanup] 
/recorddata = true
</trial>

<trial tooearly>
/stimulusframes = [1=tooearlymsg]
/trialduration = 500
</trial> 

<trial tooslow>
/stimulusframes = [1=tooslowmsg]
/trialduration = 500
</trial>

***********************************
all trial sequences
***********************************
<trial cleanup>
/stimulusframes = [1 = eraser]
/trialduration = values.cleanuptime
/recorddata = false
</trial>

<trial rest>
/stimulusframes = [1 = resttext, restclock]
/trialduration = values.restperiod
/recorddata = false
</trial>


<trial feedback>
/ontrialbegin = [if (values.correct == 1) {text.feedback.textcolor = green; values.selectfeedback = 1}
            else {text.feedback.textcolor = red; values.selectfeedback = 2}]
/stimulusframes = [1 = eraser, feedback]
/branch = [trial.cleanup]
/recorddata = false
/trialduration = values.feedback_duration
</trial>


*******************************************************************************************************************
*******************************************************************************************************************
BLOCKS
*******************************************************************************************************************

<block practice_compatible_fixed>
/preinstructions = (practice_compatible)
/onblockbegin = [values.practice = 1]
/onblockbegin = [values.blockcount += 1]
/onblockbegin = [values.fixed = 1]
/onblockbegin = [values.responsekey_left = values.responsekey1; values.responsekey_right = values.responsekey2]
/trials = [1-20= noreplace(targetleft, targetright)]

/onblockend = [reset(list.congruence_smalltarget_left)]
/branch = [block.rest]
</block>


<block compatible_fixed>
/preinstructions = (compatible)
/onblockbegin = [values.practice = 0]
/onblockbegin = [values.blockcount += 1]
/onblockbegin = [values.fixed = 1]
/onblockbegin = [values.responsekey_left = values.responsekey1; values.responsekey_right = values.responsekey2]
/trials = [1-20 = noreplace(targetleft, targetright)]

/onblockend = [reset(list.congruence_smalltarget_left)]
/branch = [block.rest]
</block>

*************************
Helper Blocks
**************************

Resets relevant values after practice
<block resetvalues>
/preinstructions = (practiceend)
/onblockbegin = [values.blockcount = 0]
/onblockbegin = [values.correct_small_congruent; values.correct_small_incongruent = 0]
/onblockbegin = [values.rtsum_small_congruent; values.rtsum_small_incongruent = 0]
</block>

<block rest>
/onblockbegin = [if (values.blockcount == values.restperiod) values.restperiod = values.restperiod
                  else values.restperiod = values.regular_restperiod]
/trials = [1 = rest]
</block>

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

<expt >
/preinstructions = (intro)
/postinstructions = (end)
/blocks = [1-4 = noreplace(practice_compatible_fixed)]
</expt>

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

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 108K
Could you please attach your script (instead of pasting it into a response) and please include all files necessary to run it (pictures etc.)? Thanks.

What I can already tell you:

- Your <trial pretrialpauseleft> and <trial pretrialpauseright> elements serve no purpose. Your script never runs them. Why don't you set /pretrialpause attributes in your *target* trials (<trial targetleft>, <trial targetright>)?

- You should also remove any elements from the script that you do not need anymore. This, for example, applies to <trial targetleft_cue>, which serves no purpose anymore and is never run.

Let me also reiterate one previous piece of advice: It may be easier to build something from scratch rather than modifying an existing script that *does all sorts of complicated things you neither want or need*. The latter can easily amount to trying to fit a square peg in a round hole.

daphne golden
daphne golden
Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)
Group: Awaiting Activation
Posts: 13, Visits: 475
Hi. Dave, there are 2 sound files that I am unable to upload in this system. They are located in the child ANT script on your website  neg_feedback.wav and pos_feedback.wav.
If you need me to do anything else please let me know.

I really appreciate this. It seems that by adding several responses, I'm just not able to figure it out. 
Thanks Daphne

Attachments
L_fish.png (167 views, 743 bytes)
R_fish.png (147 views, 706 bytes)
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 108K
> there are 2 sound files that I am unable to upload in this system

Please put all the files in a ZIP archive and attach said archive to this thread.

daphne golden
daphne golden
Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)
Group: Awaiting Activation
Posts: 13, Visits: 475
I hope this worked. The sounds and pictures are from this zip folder. THanks Again Daphne
Attachments
childANT.zip (117 views, 508.00 KB)
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 108K
Thanks. May I ask:

(1) Why are all those elements serving no purpose still in the script (see my previous reply)? Do you plan to use them and don't know how? If so, what do you intend them to do and when? It's not possible to infer that from code that ostensibly doesn't function as you intend it to. Please clarify and be as specific as possible.

(2) There are a number of redundant <values> entries in the script. You have multiple values that all carry the same name (e.g. values.pretrialpause is defined twice, so is values.spacingfactor, etc.). Why? Do you intend these various copies to do different things? Note that you cannot have several identically named values (or several elements of the same type with the same name) -- how is the application supposed to know which one you actually mean at any given time if there are several?



daphne golden
daphne golden
Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)Partner Member (583 reputation)
Group: Awaiting Activation
Posts: 13, Visits: 475
I'll look through it.


I keep adding things to see, if my trials work. 

If it does not give me a problem, I may have missed things.  

I am taking from the tutorials and applying it to the old flanker. Removing and adding things as I address each issue. One at a time.

The only thing that I need to do at this point is the timing issue and to ensure the data is correct. 

FYI- My computer skills are poor. I expected to use an already scripted test when we purchased this, but it is too long for my population, and had to resort to this mess. 
I'll keep at it.  

Sorry
Daphne
I attached the article explaining the test I am trying to create, if that helps.

Attachments
christ 2011.pdf (345 views, 198.00 KB)
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search