Hello
I'm glad to find this forum!!
for few days, I'm searching for the way to insert pictures before experimental tasks,
but I think I couldn't find anyway.
I want to insert pictures for distraction to induce negative emotion, and then start n-back task, with every trial.
Is there any one to help me to find errors in my script?
I would really appreciate for your help.
************************************************************************************************************************************************************************
DEFAULTS
requires Inquisit 4.0.0.0 or greater
<
defaults>
/
minimumversion = "4.0.0.0"
/
screencolor = black
</
defaults>
/
canvasaspectratio = (4,3)
************************************************************************************************************************************************************************
************************************************************************************************************************************************************************
CUSTOM VALUES
******************
editable by experimenter: (changes need to be made
under values below)
******************
trialduration:Interstimulusinterval for regular n-back trials, default = 2500ms,
posttrialpause_aftertarget0
:the
posttrialpause after the target in 0nback tasks disappears from sight and the actual 0
nback testing starts
(
default = 2000ms, to make it comparable to the remaining trials)
showtarget0
:the amount of time the target for N = 0 trials should be presented; default = 3000
instruction_duration
:the time the instructions for each experimental block are shown, default = 9000ms
only applies if instructions for experimental blocks are NOT self-paced
(see INSTRUCTIONS -> INSTRUCTION TRIALS -> trial.expinstructiontrial for further info)
the default for this script are self-paced instructions
highestN:default N = 3
lowestN:default N = 0
debugmode = 0debugmode = 1: targetalerts are shown on screen,
debugmode = 0, no targetalerts are shown (default)
(in general: if levels of N are changed, adjustments need to be made to
instructions and list.Nlevel)
<values >
/trialduration = 4750
/pretrialpicture_beforetarget0 = 3000
/pretrialpause_beforetarget0 = 1250
/instruction_duration = 9000
/highestN = 3
/lowestN = 1
/showtarget0 = 3000
/debugmode = 0
</values>
******************
updated automatically during runtime:
******************
/completed:0 = script was not completed (script was prematurely aborted); 1 = script was completed (all conditions run)
minus1:contains the stimulusitemnumber of the stimulus in the trial preceding the current one
minus2:contains the stimulusitemnumber of the stimulus shown 2 trials before the current one
minus3:contains the stimulusitemnumber of the stimulus shown 3 trials before the current one
minus4:contains the stimulusitemnumber of the stimulus shown 4 trials before the current one
stim:contains the current stimulusitem
stimnumber:contains the current stimulusitemnumber
N:the lag between a target and the stimulus it repeats
currenttarget:contains the stimulusnumber of the current target
(a target in N = 0 trials is a stimulus with the same stimulus number as stored in target0)
Hits:codes the number of correctly identifiying a target
FalseA:codes the number of times a participant identifies a non-target as a target
Misses:codes the number of times a participant misses to identify a target
CorrReject:codes the number of times a participant correctly identifies a non-target (and does nothing)
values.TotalHits:the number of total hits across all experimental blocks
values.TotalFA:the number of total false alarms across all experimental blocks
values.TotalBlocks:the total number of experimental blocks run
values.DV:dependent variable (DV) in Jaeggi et al (2010): the proportion of (TotalHits - TotalFA)/number of total blocks
starttrialcounter:keeps track of how many start trials have been run
trialduration_starttrial:the trialduration time for the starttrials, depends on level of N (starttrial for N = 0 trials differs)
starttrialposttrialpause:the posttrialpause of starttrials (can be set for N = 0 trials, for all others it's 0)
<values>
/completed = 0
/minus1 = 0
/minus2 = 0
/minus3 = 0
/minus4 = 0
/N = 0
/currenttarget = 0
/Hits = 0
/FalseA = 0
/Misses = 0
/CorrReject = 0
/TotalHits = 0
/TotalFA = 0
/DV = 0
/TotalBlocks = 0
/starttrialcounter = 0
/trialduration_starttrial = 0
/starttrialpretrialpicture = 0
/starttrialpretrialpause = 0
</values>
**************************ADDITIONAL N-LEVELS*************************************
* if additional N-levels are needed, create and add further "minusN" values and set them to 0,
Example: N = 5
/minus5 = 0
************************************************************************************************************************************************************************
************************************************************************************************************************************************************************
EXPRESSIONS
expressions.selectinstruct helps to select the adequate instructions for adaptive n-back testing
<expressions>
/selectinstruct = values.N + 1
</expressions>
************************************************************************************************************************************************************************
************************************************************************************************************************************************************************
LISTS
*list.Nlevel pseudorandomly selects the next N level (the experiment runs as many blocks as there are
items in this list)
! if you do NOT run level N = 3, remove all 3s from the item list of this list
! if you want to run a level more or fewer times adjust the number of the digits in the item list accordingly
! if you want to run the levels in sequence, set /select = sequence
IN GENERAL: if you run different levels of N or change the number of repetitions, you need to adjust the item list of
list.nlevel
<list Nlevel>
/items = (1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3)
/ replace = false
</list>
****list Variables to select notargetvalue
*list.notargetvalue selects any of the 8 numbers but the one selected for targetvalue
<list notargetvalue>
/items = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)
/ not = (values.currenttarget)
/ replace = true
</list>
<list starttrialpretrialpicture>
/items = (1)
/ replace = true
</list>
************************************************************************************************************************************************************************
************************************************************************************************************************************************************************
DATA COLLECTION
this implementation suggests to collect the following information:
date:Date of Experiment
time:Time of Day
subject:Subjectnumber
values.N:the type of N-back trial
blockcode:the name of the current block
values.TotalBlocks:the total number of experimental blocks run
trialcode:the name of the current trial
stimulusitem:the file of the stimulus shown during a trial
values.currenttarget:the item number of the current target
response:the response of the participant
correct:the correctness of the response
latency:how fast a participant responded within the given timeframe, if at all
values.Hits:the sum of Hits in a block
values.FalseA:the sum of False Alarms in a block
values. Misses:the sum of Misses in a block
values.CorrReject:the sum of Correct Rejections in a block
values.TotalHits:the sum of total hits across all experimental blocks
values.TotalFA:the number of total false alarms across all experimental blocks
values.DV:the proportion of (TotalHits - TotalFA)/number of experimental blocks
*********************
raw data
*********************
<data>
/file = "SingleTaskNBack_letters_rawdata.iqdat"
/columns = [date, time, subject, values.N, blockcode, values.TotalBlocks, trialcode, trialnum, stimulusitem,
values.currenttarget, response, correct, latency,
values.Hits, values.FalseA, values.Misses, values.CorrReject,
values.TotalHits, values.TotalFA, values.DV]
/ separatefiles = true
</data>
*********************
summary data
*********************
script.startdate:date script was run
script.starttime:time script was started
script.subjectid:subject id number
script.groupid:group id number
script.elapsedtime:time it took to run script (in ms)
/completed:0 = script was not completed (script was prematurely aborted); 1 = script was completed (all conditions run)
values.TotalHits:the sum of total hits across all experimental blocks
values.TotalFA:the number of total false alarms across all experimental blocks
values.DV:the proportion of (TotalHits - TotalFA)/number of experimental blocks
************************************************************************************************************************************************************************
************************************************************************************************************************************************************************
INSTRUCTIONS
***********INSTRUCTION SLIDES*****************************
Note: these instruction slides are adapted from the original instructions kindly provided to Millisecond Software by Jaeggi et al .
Thank you!
*********************************************************
NOTE:
If you only run N = 0 to N = 2, remove/exchange the instructionslides that reference N = 3
**********************************************************
<item Nback_startinstructions>
/1 = "SingleNbackInstructions_letters_start.gif"
/2 = "SingleNbackInstructions_letters_N0.gif"
/3 = "SingleNbackInstructions_letters_N1.gif"
/4 = "SingleNbackInstructions_letters_N2.gif"
/5 = "SingleNbackInstructions_letters_N3.gif"
/6 = "SingleNbackInstructions_letters_practice0123.gif"
</item>
*********************************************************
Alternative if only N=0 - N=2 is run
-> "SingleNbackInstructions_letters_practice012.gif"
*********************************************************
*********************************************************
Alternative if only N=0 - N=2 is run
-> "SingleNbackInstructions_letters_practiceend012.gif"
*********************************************************
*slides to start experimental trials/end experiment
<item startendslides>
/1 = "StartExpt.gif"
/2 = "ThankYouSlide.gif"
</item>
*Instructions for individual experimental N-levels (not original)
<item expinstructions>
/1 = "SingleNbackInstructionsN0_letters_exp.gif"
/2 = "SingleNbackInstructionsN1_letters_exp.gif"
/3 = "SingleNbackInstructionsN2_letters_exp.gif"
/4 = "SingleNbackInstructionsN3_letters_exp.gif"
</item>
*******CODE CHANGES:
If you would like to run different levels of N in practice/experimental trials, change/add the necessary instruction slides
under the appropriate item categories above, as well as pay attention to the changes necessary under "Instruction Blocks"
***********INSTRUCTION IMAGE SELECTION******************************************
<picture SingleNbackinstructions_start>
/ items = Nback_startinstructions
/ select = sequence
/ size = (100%, 100%)
</picture>
<picture StartExp_slide>
/ items = startendslides
/ select = 1
/ size = (100%, 100%)
</picture>
<picture EndExp_slide>
/ items = startendslides
/select = 2
/ size = (100%, 100%)
</picture>
*instructions for individual experimental trials are selected depending on level of N
<picture expinstructionslide>
/items = expinstructions
/select = expressions.selectinstruct
/size = (100%, 100%)
</picture>
<picture repeatpractice_page>
/items = ("SingleNbackInstructions_practicerepeat.gif")
/size = (100%, 100%)
</picture>
***********INSTRUCTION TRIALS*******************************************
****************************************************************************************
Note:
* instructions for each level of N are self-paced.
* If they should be shown for a predetermined time (e.g. 9s, see Ragland et al, 2002)
use the following code instead in trial.expinstructiontrial:
/ stimulusframes = [1 = expinstructionslide, eraserrec, wait]
/ validresponse = (noresponse)
/ timeout = (values.instruction_duration)
****************************************************************************************
<trial expinstructiontrial>
/ stimulusframes = [1 = expinstructionslide]
/ validresponse = (57)
/ recorddata = false
</trial>
<trial Nbackinstruct_starttrial>
/ stimulusframes = [1 = SingleNbackinstructions_start]
/ validresponse = (57)
/ recorddata = false
</trial>
<trial StartExp_trial>
/ stimulusframes = [1 = StartExp_slide]
/ validresponse = (57)
/ recorddata = false
</trial>
<trial EndExp_trial>
/ stimulusframes = [1 = EndExp_slide]
/ validresponse = (57)
/ recorddata = false
</trial>
*************INSTRUCTION BLOCKS*************************************************************************************
ATTENTION: PRACTICE BLOCKS
(1) This block sets the beginning N value for practice trials to the lowest level of N run in the experiment
(2) runs instructions 1-6, for N=0-3, if more/fewer than four N levels are run adjust /trials = [1-X.....]
Example: N=0 to N = 2: / trials = [1-5 = Nbackinstruct_starttrial]
<block Nbackinstruct_start>
/ trials = [1-6 = Nbackinstruct_starttrial]
/ recorddata = false
/ onblockbegin = [values.N = values.lowestN]
</block>
EXPERIMENTAL BLOCKS
<block StartExp>
/ trials = [1 = StartExp_trial]
/ recorddata = false
/ onblockbegin = [
values.TotalHits = 0;
values.TotalFA = 0;
values.TotalBlocks = 0;
values.DV = 0
]
</block>
<block EndExp>
/ trials = [1 = EndExp_trial]
</block>
************************************************************************************************************************************************************************
************************************************************************************************************************************************************************
************************************************************************************************************************************************************************
************************************************************************************************************************************************************************
LETTER ITEMS
* 20 consonants
<item letters>
/1 = "B"
/2 = "C"
/3 = "D"
/4 = "F"
/5 = "G"
/6 = "H"
/7 = "J"
/8 = "K"
/9 = "L"
/10 = "M"
/11 = "N"
/12 = "P"
/13 = "Q"
/14 = "R"
/15 = "S"
</item>
<item starttrialpretrialpicture>
/1 = "dog.gif"
</item>
***randomly selects one of the letters
<text startletter>
/ items = letters
/select = replace
/ position = (50%, 50%)
/ txcolor = (white)
/ txbgcolor = (black)
/ fontstyle = ("Arial", 20%, false, false, false, false, 5, 0)
</text>
***selects any letter that cannot be a target
<text nontargetletter>
/ items = letters
/select = notargetvalue
/ position = (50%, 50%)
/ txcolor = (white)
/ txbgcolor = (black)
/ fontstyle = ("Arial", 20%, false, false, false, false, 5, 0)
</text>
***selects the item with the same item number as the established target
<text targetletter>
/ items = letters
/select = values.currenttarget
/ position = (50%, 50%)
/ txcolor = (white)
/ txbgcolor = (black)
/ fontstyle = ("Arial", 20%, false, false, false, false, 5, 0)
</text>
************************************************************************************************************************************************************************
************************************************************************************************************************************************************************
FEEDBACK MESSAGES FOR PRACTICE TRIALS ONLY
(default: they are NOT used)
<text ErrorFeedback>
/ items = ("ERROR")
/ fontstyle = ("Arial", 5.00%, true, false, false, false, 5, 0)
/ txcolor = (255, 0, 0)
/ txbgcolor = (0, 0, 0)
/ position = (50%, 70%)
</text>
<text CorrectFeedback>
/ items = ("CORRECT")
/ fontstyle = ("Arial", 5.00%, true, false, false, false, 5, 0)
/ txcolor = (0, 255, 0)
/ txbgcolor = (0, 0, 0)
/ position = (50%, 70%)
</text>
************************************************************************************************************************************************************************
************************************************************************************************************************************************************************
ASSISTANT STIMULI
*****acts as an eraser after showing the key stimuli for 500ms, staying on for the remainder of the trial
<shape eraser>
/ shape = rectangle
/ size = (100%, 100%)
/ color = (0, 0, 0)
</shape>
*****reminder that the letter participants see during the first trial in N = 0 nback trials is the target
<text targetreminder>
/ items = ("this is the target")
/ position = (50%, 25%)
/ txbgcolor = (black)
/ txcolor = (black)
/ fontstyle = ("Arial", 3.00%, false, false, false, false, 5, 0)
</text>
*****For timed instructions, this shape covers up the original instructions (on slides)
that instruct participants to use the Spacebar to continue
<shape eraserrec>
/shape = rectangle
/color = (black)
/ position = (50%, 95%)
/ size = (100%, 8%)
</shape>
*****For timed instructions this text alerts participants that the task starts in the
predetermined amount of time (default: 9s)
<text wait>
/ items = ("the task will start automatically in <%values.instruction_duration/1000%> s")
/ position = (50%, 95%)
/ txbgcolor = (black)
/ txcolor = (white)
/ fontstyle = ("Arial", 2.08%, false, false, false, false, 5, 0)
</text>
*****Debug Code:
<text targetalert>
/items = ("target")
/position = (50%, 80%)
/txcolor = (black)
/txbgcolor = (black)
/ fontstyle = ("Arial", 3%, true, false, false, false, 5, 1)
</text>
************************************************************************************************************************************************************************
************************************************************************************************************************************************************************
TRIALS
*there are 3 types of trials
1. start: presented at beginning of block when number of trials too small for Target trials; they can present
any of the stimuli (N = 0, start trial presents the target shape)
2. nontarget:trials that present stimuli that do not repeat the stimulus of n-trials before
3. target:trials that present Target stimuli
**********************************
Starttrial
**********************************
NOTE:
for N = 0 trials:
- the first trial shows the target for a set amount of time (editable), together with a text stimulus that
reminds participants that this letter is the target.
- There is a pause (length is editable) before the next trial starts
*start trial runs N-times (unless N = 0, then it runs N = 1 time)
<trial start>
/ ontrialbegin = [if (values.N == 0)
{text.targetreminder.textcolor = red;
shape.eraser.color = transparent;
values.starttrialpretrialpicture = values.pretrialpicture_beforetarget0;
values.starttrialpretrialpause = values.pretrialpause_beforetarget0;
values.trialduration_starttrial = values.showtarget0}
else
{values.starttrialpretrialpicture = 0;
values.starttrialpretrialpause = 0;
values.trialduration_starttrial = values.trialduration}]
/ stimulustimes = [0 = starttrialpretrialpicture; 3000 = starttrialpretrialpause; 4250 = startletter, targetreminder; 4750 = eraser]
/ validresponse = (noresponse, 30)
/ correctresponse = (noresponse)
/ responsetime = 0
/ ontrialbegin = [
{if (values.N == 1) values.currenttarget = values.minus1};
{if (values.N == 2) values.currenttarget = values.minus2};
{if (values.N == 3) values.currenttarget = values.minus3};
{if (values.N == 4) values.currenttarget = values.minus4};
values.starttrialcounter += 1;
]
/ ontrialend = [
{if (values.N == 0) values.currenttarget = text.startletter.currentitemnumber};
values.minus4 = values.minus3;
values.minus3 = values.minus2;
values.minus2 = values.minus1;
values.minus1 = text.startletter.currentitemnumber
]
/ ontrialend = [text.targetreminder.textcolor = black; shape.eraser.color = black]
/ pretrialpause = (values.starttrialpretrialpause)
/trialduration = values.trialduration_starttrial
/branch = [if (values.starttrialcounter < values.N) trial.start]
</trial>
**********************************
Nontarget Trials
**********************************
<trial nontarget>
/ stimulustimes = [0 = starttrialpretrialpicture; 3000 = starttrialpretrialpause; 4250 = nontargetletter; 4750 = eraser]
/validresponse = (noresponse, 30)
/ correctresponse = (noresponse)
/ ontrialbegin = [
{if (values.N == 1) values.currenttarget = values.minus1};
{if (values.N == 2) values.currenttarget = values.minus2};
{if (values.N == 3) values.currenttarget = values.minus3};
{if (values.N == 4) values.currenttarget = values.minus4};
]
/ ontrialend = [
values.minus4 = values.minus3;
values.minus3 = values.minus2;
values.minus2 = values.minus1;
values.minus1 = text.nontargetletter.currentitemnumber;
values.CorrReject = values.CorrReject + trial.nontarget.correct;
values.FalseA = values.FalseA + trial.nontarget.error;
values.TotalFA = values.TotalFA + trial.nontarget.error;
values.DV = (values.TotalHits - values.TotalFA)/values.TotalBlocks;
]
/ responsetime = 0
/ trialduration = values.trialduration
</trial>
**********************************
Target Trials
**********************************
**if target, press the letter "A" (code: 30)
<trial target>
/ stimulustimes = [0 = starttrialpretrialpicture; 3000 = starttrialpretrialpause; 4250 = targetletter, targetalert; 4750 = eraser]
/validresponse = (noresponse, 30)
/ correctresponse = (30)
/ ontrialbegin = [
{if (values.N == 1) values.currenttarget = values.minus1};
{if (values.N == 2) values.currenttarget = values.minus2};
{if (values.N == 3) values.currenttarget = values.minus3};
{if (values.N == 4) values.currenttarget = values.minus4};
]
/ ontrialend = [
values.minus4 = values.minus3;
values.minus3 = values.minus2;
values.minus2 = values.minus1;
values.minus1 = text.targetletter.currentitemnumber;
values.Hits = values.Hits+ trial.target.correct;
values.Misses = values.Misses + trial.target.error;
values.TotalHits = values.TotalHits + trial.target.correct;
values.DV = (values.TotalHits - values.TotalFA)/values.TotalBlocks;
]
/ responsetime = 0
/ trialduration = values.trialduration
</trial>
********************************ADDITIONAL N-LEVELS*****************************************************
For each trial type:
(1) add {if (values.N == X) values.currenttarget = values.minusX};, e.g. N = 5
/ ontrialbegin = [
.....
{if (values.N == 1) values.currenttarget = values.minus1};
{if (values.N == 2) values.currenttarget = values.minus2};
{if (values.N == 3) values.currenttarget = values.minus3};
{if (values.N == 4) values.currenttarget = values.minus4};
=>{if (values.N == 5) values.currenttarget = values.minus5};
]
(2) add values.minusX = values.minus(X-1) e.g. N = 5 - largest N goes on top of the list
/ ontrialend = [
=>values.minus5 = values.minus4;
values.minus4 = values.minus3;
values.minus3 = values.minus2;
values.minus2 = values.minus1;
values.minus1 = picture.targetshape.currentitemnumber;
....
]
************************************************************************************************************************************************************************
************************************************************************************************************************************************************************
PRACTICE-BLOCKS
* Practice Blocks give feedback and do NOT record data
* Block starts with
(a) Instructiontrial
(b) N start-trials that cannot present Targets yet (no data collected) , if N = 0, the first trial presents the target letter
(c) 9 practice trials: ratio targets : nontargets = 1 : 2
* stops after lever N = highestN (set by experimenter)
(d) runs from the lowest N to the highest N
if trial feedback is desired:
/ errormessage = true(ErrorFeedback, 500)
/ correctmessage = true(CorrectFeedback, 500)
************************************************************************************************************************************************************************
************************************************************************************************************************************************************************
EXPERIMENTAL-BLOCKS NONADAPTIVE
* Block starts with
(a) Instructiontrial
(b) N start-trials that cannot present Targets yet
(c) 15 Experimental trials
* Experimental trials: ratio targets : nontargets = 1 : 2
* N level is pseudo-randomly selected by list.Nlevel
* Block runs as many times as there are items in list.Nlevel
<block s_ntask>
/ onblockbegin = [values.N = list.Nlevel.nextvalue]
/ onblockbegin = [
values.currenttarget = 0; values.minus1 = 0; values.minus2 = 0; values.minus3 = 0; values.minus4 = 0;
values.Hits = 0; values.FalseA = 0; values.Misses = 0; values.CorrReject = 0;
values.TotalBlocks += 1;
values.starttrialcounter = 0;
]
/ trials = [1 = expinstructiontrial; 2 = start; 3 - 17 = noreplace(nontarget, nontarget, target)]
/ screencolor = (0, 0, 0)
/ branch = [if (values.TotalBlocks < list.Nlevel.itemcount) block.s_ntask
else block.EndExp]
</block>
***********************************************ADDITIONAL N-LEVELS********************************************************
(1) add values.minusX = 0 to
/ onblockbegin = [
values.currenttarget = 0; values.minus1 = 0; values.minus2 = 0; values.minus3 = 0; values.minus4 = 0;
.....
]
Example: N = 5
/ onblockbegin = [
values.currenttarget = 0; values.minus1 = 0; values.minus2 = 0; values.minus3 = 0; values.minus4 = 0;
values.minus5 = 0;
.....
]
************************************************************************************************************************************************************************
************************************************************************************************************************************************************************
EXPERIMENT
*After running the initial instructions, participants work through practice blocks for N = lowestN to N = highestN
* After practice, participants work through 3 blocks for each of the level of N (levels are pseudorandomly determined)
<expt>
/onexptbegin = [if (values.debugmode == 1) text.targetalert.textcolor = (red)]
/ blocks = [
1 = Nbackinstruct_start;
2 = StartExp;
3 = s_ntask
]
/onexptend = [values.completed = 1]
</expt>
************************************************************************************************************************************************************************
End of Script
************************************************************************************************************************************************************************