DUAL N-BACK TASK - nonadaptive SCRIPT INFO Script Author: Katja Borchert, Ph.D. (katjab@millisecond.com) for Millisecond Software LLC Date: October, 2011 last updated: 02-14-2018 by K.Borchert (katjab@millisecond.com) for Millisecond Software LLC Script Copyright © 02-14-2018 Millisecond Software BACKGROUND INFO *Purpose* This Inquisit script provides trials and instructions for DUAL n-back tasks with blue squares in 8 different screen locations as well as spoken Roman letters. The script closely follows the procedure for non-adaptive DUAL n-back tasks provided by Jaeggi et al (2010), Experiment 1, and implements original instructions (or new ones closely following the original ones) and stimuli kindly provided by the authors. Because the script closely follows the procedure implemented by Jaeggi et al., the provided script runs N = 2, N = 3, N = 4 trials. However, different levels of N can be run with simple code changes. Reference: Jaeggi S.M, Studer-Luethi, B., Buschkuehl, M, Su, Y.-F., Jonides, J., Perrig, W.J. (2010). The relationship between n-back performance and matrix reasoning - implications for training and transfer. Intelligence, 38, 625-635. Millisecond Software LLC thanks Jaeggi et al (2010) for kindly providing original instruction materials, stimuli, as well as ample assistance! *Task* In Dual n-back tasks, participants are presented with two sequences of stimuli in two modalities at the same time Here: a) VISUAL: a random sequence of blue squares that can be presented in 8 different locations on the screen and b) AUDITORY: a random sequence of 8 spoken Roman letters In each trial one visual and one auditory stimulus are presented and participants are asked to indicate whether the currently presented stimuli fulfill the following criteria: for N=0 trials*: - is the location of the square the same as the one first presented? If so (it's a target), and press "A". If not, don't press "A". - is the letter the same as the one presented first? If so (it's a target), and press "L". If not, don't press "L". for N=1 trials: - is the location of the square the same as the one in the previous trial? If so (it's a target), and press "A". If not, don't press "A". - is the letter the same as the one in the previous trial? If so (it's a target), and press "L". If not, don't press "L". for N=2 trials: - is the location of the square the same as the one two trials before? If so (it's a target), and press "A". If not, don't press "A". - is the letter the same as the one two trials before? If so (it's a target), and press "L". If not, don't press "L". for N=3 trials: - is the location of the square the same as the one three trials before? If so (it's a target), and press "A". If not, don't press "A". - is the letter the same as the one three trials before? If so (it's a target), and press "L". If not, don't press "L". for N=4 trials: - is the location of the square the same as the one four trials before? If so (it's a target), and press "A". If not, don't press "A". - is the letter the same as the one four trials before? If so (it's a target), and press "L". If not, don't press "L". *The set-up for 0-nback tasks as well as instructions in this script differ from the procedure used by Jaeggi and collegues in her earlier research. Jaeggi and collegues used a pre-defined location and a pre-defined letter. In this script, the target location and target letter are defined at runtime for each participant during the first trial. Participants are instructed to pay close attention to this first presentation. DATA FILE INFORMATION: The default data stored in the data files are: (1) Raw data file: 'DualTaskNBack_raw.iqdat' (a separate file for each participant) build: Inquisit build computer.platform: the platform the script was run on date, time, subject, group: date and time script was run with the current subject/groupnumber 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: first shown stimulus (=square) values.v_position: contains the position of the current square (1 = (25, 25), 2 = (50, 25), 3 = (75, 25), 4 = (25, 50), 5 = (75, 50), 6 = (25, 75), 7 = (50, 75), 8 = (75, 75)) values.v_currenttarget: the position number of the current target shape stimulusitem: second presented stimulus (=sound) values.a_stimnumber: contains item number of the currently presented sound values.v_currenttarget: the item number of the current target sound values.1response: the value of the first response (if any) values.2response: the value of the second response (if any) correct: 1 = if correct response, 0 = otherwise values.1latency: the latency value of 1response (in ms) values.2latency: the latency value of 2response (in ms) latency: the latency value of the last response made (if any), MAX=3000 (=no response made) values.trial_Hitv: trial Hit for visual stimulus (1 = hit, 0 = no hit) (visual Hit: any trial response -either the first or the second- for a visual target) values.trial_Missv: trial Miss for visual stimulus (1 = miss, 0 = no miss) (visual Miss: no trial response for a visual target if a visual target was presented) values.trial_CRv: trial Correct Rejection for visual stimulus (1 = CR, 0 = no CR) (visual CR: no trial response for a visual target if no visual target was presented) values.trial_FAv: trial False Alarm for visual stimulus (1 = FA, 0 = no FA) (visual FA: any trial response for visual target -either the first or the second- if no visual target was presented) values.trial_Hita: trial Hit for auditory stimulus (1 = hit, 0 = no hit) (auditory Hit: any trial response -either the first or the second- for an auditory target) values.trial_Missa: trial Miss for auditory stimulus (1 = miss, 0 = no miss) (auditory Miss: no trial response for an auditory target if an auditory target was presented) values.trial_CRa: trial Correct Rejection for auditory stimulus (1 = CR, 0 = no CR) (auditory CR: no trial response for an auditory target if no auditory response was presented) values.trial_FAa: trial False Alarm for auditory stimulus (1 = FA, 0 = no FA) (auditory FA: any trial response for an auditory target -either the first or the second- if no auditory response was presented) values.v_Hits: the number of Hits for visual modality values.v_FalseA: the number of False Alarms for visual modality values. v_Misses: the number of Misses for visual modality values.v_CorrReject: the number of Correct Rejections for visual modality values.a_Hits: the number of Hits for auditory modality values.a_FalseA: the number of False Alarms for auditory modality values. a_Misses: the number of Misses for auditory modality values.a_CorrReject: the number of Correct Rejections for auditory modality values.v_TotalHits: the number of total hits across all experimental blocks for the visual modality values.a_TotalHits: the number of total hits across all experimental blocks for the auditory modality values.v_TotalFA: the number of total false alarms across all experimental blocks for the visual modality values.a_TotalFA: the number of total false alarms across all experimental blocks for the auditory modality values.DV: the proportion of ((v_TotalHits - v_TotalFA) + (a_TotalHits - a_TotalFA)/2) /number of total experimental blocks (2) Summary data file: 'DualTaskNBack_summary*.iqdat' (a separate file for each participant) 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) computer.platform: the platform the script was run on /completed: 0 = script was not completed (prematurely aborted); 1 = script was completed (all conditions run) values.v_TotalHits: the number of total hits across all experimental blocks for the visual modality values.a_TotalHits: the number of total hits across all experimental blocks for the auditory modality values.v_TotalFA: the number of total false alarms across all experimental blocks for the visual modality values.a_TotalFA: the number of total false alarms across all experimental blocks for the auditory modality values.DV: the proportion of ((v_TotalHits - v_TotalFA) + (a_TotalHits - a_TotalFA)/2) /number of total experimental blocks EXPERIMENTAL SET-UP (1) Dual n-back Experiment (non-adaptive) information: - After instructions, participants receive 10 trials of practice per level N tested (here: N = 2, N = 3, N = 4) - with possibility of repeat. - After practice, participants receive 3 blocks per level N tested (here: N = 2, N = 3, N = 4). Note: N-levels run The levels and repetitions of N run by this script are controlled by list.nextN_practice and list.nextN under section Editable Lists. By default, the list runs the selection items in sequence. The levels of N can be easily altered (if altered for practice, the instruction slides might have to be edited as well) (2) Dual n-back BLOCK information: - Each dual n-task block consists of 20 + trials. => + trials are the N trials that cannot display target shapes yet (=start trials). Their numbers vary depending on N. The data collected during these start trials are NOT included in performance counts for Correct Rejections/False Alarms. => Of the actual 20 experimental trials, 4 present a visual target only, 4 present an auditory target only, 2 present both targets and 10 present no targets at all - The computer selects randomly a) which kind of trial b) what letter/ square location to use if it is not a target (3) Dual n-back TRIAL informations: - Each trial presents the square/letter for 500ms and waits another 2500ms before presenting the next square/letter in the sequence. - Participants have the entire 3000ms to respond by pressing "A", "L", or both if they detect a target or two. 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: /runPractice: true (1): practice session runs (default); false (0): no practice is run /Debugmode = 0 Debugmode = 1, target alerts are presented Debugmode = 0, target alerts are turned-off (default) /stimulusPresentationtime: the presentation time (in ms) of the stimuli (default: 500ms) /SOA: the stimulus onset asynchrony in ms (default: 3000ms)- also response Window ************************************************************************************************************** ************************************************************************************************************** EDITABLE PARAMETERS: change editable parameters here ************************************************************************************************************** ************************************************************************************************************** /runPractice = true /Debugmode = 0 /stimulusPresentationtime = 500 /SOA = 3000 ************************************************************************************************************** ************************************************************************************************************** EDITABLE STIMULI: change editable stimuli here ************************************************************************************************************** ************************************************************************************************************** *original sounds, kindly provided by Jaeggi et al (2010) / 1 = "C" / 2 = "D" / 3 = "G" / 4 = "K" / 5 = "P" / 6 = "Q" / 7 = "T" / 8 = "V" /1 = "square.gif" ************************************************************************************************************** ************************************************************************************************************** EDITABLE INSTRUCTIONS: change instructions here ************************************************************************************************************** ************************************************************************************************************** ***********INSTRUCTION SLIDES***************************** * Items 1-9 are ORIGINAL* instructions for N = 1, N = 2, N = 3 trials, kindly provided by Jaeggi et al. (*Minor change: SPACEBAR instead of "any key" to proceed) /1 = "DualNbackInstructions_start.gif" /2 = "DualNbackInstructions_squareN1.gif" /3 = "DualNbackInstructions_squareN2.gif" /4 = "DualNbackInstructions_squareN3.gif" /5 = "DualNbackInstructions_generalDUAL.gif" /6 = "DualNbackInstructions_generalDUAL1.gif" /7 = "DualNbackInstructions_generalDUAL2.gif" /8 = "DualNbackInstructions_practice.gif" /9 = "DualNbackInstructions_practice234.gif" NOTE: *the following items/instructions provided with the script (for N=0, N=1) are based on original slides -> "DualNbackInstructions_squareN0.gif" -> "DualNbackInstructions_practice0123.gif" -> "DualNbackInstructions_practice012.gif" -> "DualNbackInstructions_practice123.gif" /1 = "DualNbackInstructions_practiceend234.gif" NOTE: *the remaining items/instructions provided with this script (for N=0, N=1) are based on original slide ->"DualNbackInstructions_practiceend0123.gif", ->"DualNbackInstructions_practiceend012.gif", ->"DualNbackInstructions_practiceend123.gif", *slides to start experimental trials/end experiment (not original) /1 = "StartExpt.gif" /2 = "ThankYouSlide.gif" *Instructions for individual practice N-levels (not original) - not run for test blocks /1 = "DualNbackInstructionsN0exp.gif" /2 = "DualNbackInstructionsN1exp.gif" /3 = "DualNbackInstructionsN2exp.gif" /4 = "DualNbackInstructionsN3exp.gif" /5 = "DualNbackInstructionsN4exp.gif" Note: presents the instructions for the test blocks / file = "ExpInstructions.htm" Used in htmlpage 'ExpInstructions' /expInstructions = if (values.N > 0){ "

Letters:

Press 'L' if the current letter is the same one as the one that was presented <%values.N%> trial(s) before.

Squares:

Press 'A' if the current square appears in the same location as the picture <%values.N%> trial(s) before.



"; } else { "

Once you start the test, pay close attention to the first square location AND the first letter. These will be your targets for the remaining trials.

Letters:

Press 'L' if the current letter is the same as the one in the very first trial

Squares:

Press 'A' if the current square location is the same one as the one in the very first trial

" };
*******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" *A feedback page that could be presented at the end of each experimental block (NOT included in the NON-ADAPTIVE version, but is included in the ADAPTIVE version) ****************************** SUMMARY PAGES ****************************** / fontstyle = ("Arial", 2.67%, false, false, false, false, 5, 0) / txcolor = white / screencolor = black ^^ FEEDBACK ^^Performance on: ^^(1) Squares: <%(values.v_Hits + values.v_CorrReject)/20 * 100%> % correct ^^(2) Letters: <%(values.a_Hits + values.a_CorrReject)/20 * 100%> % correct ^^ FEEDBACK ^^ Performance on: ^^(1) Squares: <%(values.v_Hits + values.v_CorrReject)/10 * 100%> % correct ^^(2) Letters: <%(values.a_Hits + values.a_CorrReject)/10 * 100%> % correct ************************************************************************************************************** ************************************************************************************************************** Editable Lists ************************************************************************************************************** ************************************************************************************************************** Note: list controls the level of N run during practice. By default, practice runs level 2, 3, 4 once and in sequence /items = (2, 3, 4) / selectionmode = sequence / selectionrate = block / resetinterval = 0 Note: list controls the level of N run during the test. By default, the test runs level 2, 3, 4, repeating each level once and in sequence /items = (2, 2, 2, 3, 3, 3, 4, 4, 4) / selectionmode = sequence / selectionrate = block / resetinterval = 0 ************************************************************************************************************** !!!REMAINING CODE: Customize after careful consideration only!!! ************************************************************************************************************** ************************************************************************************************************** ************************************************************************************************************** DEFAULTS ************************************************************************************************************** ************************************************************************************************************** script requires Inquisit 5.0.5.0 or higher /canvasaspectratio = (4,3) /minimumversion = "5.0.5.0" / fontstyle = ("Arial", 3%, false, false, false, false, 5, 1) /txbgcolor = white / txcolor = (0, 0, 0) / screencolor = black ************************************************************************************************************** ************************************************************************************************************** DATA ************************************************************************************************************** ************************************************************************************************************** Note: data file explanations under User Manual Information at the top ************************ raw data ************************ /columns = (build, computer.platform, date, time, subject, group, values.N, blockcode, values.TotalBlocks, trialcode, stimulusitem, values.v_position, values.v_currenttarget, stimulusitem, values.a_stimnumber, values.a_currenttarget, values.1response, values.2response, correct, values.1latency, values.2latency, values.latency, values.trial_Hitv, values.trial_Missv, values.trial_CRv, values.trial_FAv, values.trial_Hita, values.trial_Missa, values.trial_CRa, values.trial_FAa, values.v_Hits, values.v_FalseA, values.v_Misses, values.v_CorrReject, values.a_Hits, values.a_FalseA, values.a_Misses, values.a_CorrReject, values.v_TotalHits, values.v_TotalFA, values.a_TotalHits, values.a_TotalFA, values.DV) / separatefiles = true ************************ summary data ************************ /columns = (script.startdate, script.starttime, script.subjectid,script.groupid, script.elapsedtime, computer.platform, values.completed, values.v_TotalHits, values.v_TotalFA, values.a_TotalHits, values.a_TotalFA, values.DV) / separatefiles = true ************************************************************************************************************** ************************************************************************************************************** VALUES: automatically updated ************************************************************************************************************** ************************************************************************************************************** /completed: 0 = script was not completed (script was prematurely aborted); 1 = script was completed (all conditions run) v_position: contains the position of the current square (1 = (25, 25), 2 = (50, 25), 3 = (75, 25), 4 = (25, 50), 5 = (75, 50), 6 = (25, 75), 7 = (50, 75), 8 = (75, 75)) N: the trial lag between a target and the stimulus it repeats v_currenttarget: contains the position of the current target square (a target in N = 0 trials is a stimulus with the same stimulus number as stored in target0) a_currenttarget: contains the item number of the current target sound (a target in N = 0 trials is a stimulus with the same stimulus number as stored in target0) v_Hits: codes the number of correctly identifiying a square target v_FalseA: codes the number of times a participant identifies a square non-target as a square target v_Misses: codes the number of times a participant misses to identify a square target v_CorrReject: codes the number of times a participant correctly identifies a square non-target (and does nothing) 1response: codes the first response (if any) 2response: codes the second response (if any) 1latency : codes the latency (if any) of the first response 2latency : codes the latency (if any) of the second response latency: contains trial latency data, stores the latency of the last given response (if any) v_TotalHits: the number of total hits across all experimental blocks for the visual modality a_TotalHits: the number of total hits across all experimental blocks for the auditory modality v_TotalFA: the number of total false alarms across all experimental blocks for the visual modality a_TotalFA: the number of total false alarms across all experimental blocks for the auditory modality TotalBlocks: the total number of experimental blocks run DV: the dependent variable in Jaeggi et al (2010): the proportion of (((v_TotalHits - v_TotalFA) + (a_TotalHits - a_TotalFA))/2) /number of total blocks startcounter: counts the number of start trials run repetitioncounter: keeps track of the number of experimental blocks run on a level of N /completed = 0 /stim = "" /stimnumber = 0 /N = 2 /v_position = 0 /v_currenttarget = 0 /a_currenttarget = 0 /v_Hits = 0 /v_FalseA = 0 /v_Misses = 0 /v_CorrReject = 0 /a_Hits = 0 /a_FalseA = 0 /a_Misses = 0 /a_CorrReject = 0 /xpos = 0 /ypos = 0 /a_stimnumber = 0 /1response = 0 /2response = 0 /1latency = 0 /2latency = 0 /latency = 0 /v_TotalFA = 0 /v_TotalHits = 0 /a_TotalFA = 0 /a_TotalHits = 0 /TotalBlocks = 0 /DV = 0 /starttrialcounter = 0 /repetitioncounter = 0 /trial_Hitv = 0 /trial_Missv = 0 /trial_CRv = 0 /trial_FAv = 0 /trial_Hita = 0 /trial_Missa = 0 /trial_CRa = 0 /trial_FAa = 0 /lastIndex = 0 /lastVitem = "" /lastAitem = "" ************************************************************************************************************** ************************************************************************************************************** EXPRESSIONS ************************************************************************************************************** ************************************************************************************************************** expressions.selectinstruct helps to select the adequate instructions for adaptive n-back testing /selectinstruct = values.N + 1 /fillVlist: recursive function that fills list.v_minus with N items at the beginning of each new block /fillAlist: recursive function that fills list.a_minus with N items at the beginning of each new block /fillVlist = { if (values.lastIndex < values.N){ list.v_minus.insertitem(0, 1); values.lastIndex += 1; expressions.fillVlist; } else { list.v_minus.insertitem(0, 1); }; } /fillAlist = { if (values.lastIndex < values.N){ list.a_minus.insertitem(0, 1); values.lastIndex += 1; expressions.fillAlist; } else { list.a_minus.insertitem(0, 1); }; } ************************************************************************************************************** ************************************************************************************************************** INSTRUCTIONS ************************************************************************************************************** ************************************************************************************************************** *********************INSTRUCTION IMAGE SELECTION******************************************************** / items = Nback_startinstructions / select = sequence / size = (100%, 100%) / items = practiceend /select = 1 / size = (100%, 100%) / items = startendslides / select = 1 / size = (100%, 100%) / items = startendslides /select = 2 / size = (100%, 100%) *instructions for individual experimental trials are selected depending on level of N /items = expinstructions /select = expressions.selectinstruct /size = (100%, 100%) /items = ("DualNbackInstructions_practicerepeat.gif") /size = (100%, 100%) ********************INSTRUCTION TRIALS**************************************************************** / stimulusframes = [1 = DualNbackinstructions_start] / validresponse = (57) / recorddata = false / stimulusframes = [1 = Practice_end] / validresponse = (57) / recorddata = false / stimulusframes = [1 = StartExp_slide] / validresponse = (57) / recorddata = false / stimulusframes = [1 = expinstructionslide] / validresponse = (57) / recorddata = false *only for practice trials: / stimulusframes = [1 = expinstructionslide] / validresponse = (57) / recorddata = false / errormessage = false / correctmessage = false / stimulusframes = [1 = repeatpractice_page] / validresponse = (49, 21) / recorddata = false *****stores final counts of TotalHits and TotalFAs (for both modalities), and final DV into datafile / stimulusframes = [1 = EndExp_slide] / validresponse = (57) / recorddata = true ************************************************************************************************************** ************************************************************************************************************** STIMULI ************************************************************************************************************** ************************************************************************************************************** / items = lettersounds / select = a_startcounter / position = (50%, 50%) / txcolor = white / txbgcolor = black / fontstyle = ("Arial", 20%, true) / items = lettersounds / select = a_nontargetcounter / position = (50%, 50%) / txcolor = white / txbgcolor = black / fontstyle = ("Arial", 20%, true) / items = lettersounds / select = a_targetcounter / position = (50%, 50%) / txcolor = white / txbgcolor = black / fontstyle = ("Arial", 20%, true) /items = bluesquare /select = 1 / position = (values.xpos, values.ypos) / size = (25%, 25%) / transparentcolor = black **************************** ASSISTANT STIMULI **************************** *****acts as an eraser after showing the key stimuli for 500ms, staying on for the remainder of the 3000ms dedicated to each trial / shape = rectangle / size = (90%, 90%) / color = black / position = (50%, 50%) *****fixation cross / items = ("FixationPoint.gif") /position = (99%, 99%) /size = (1%, 1%) / transparentcolor = black / erase = false ******Debug Elements /items = ("letter") /position = (1%, 1%) / fontstyle = ("Arial", 1%, false, false, false, false, 5, 1) / txcolor = black /txbgcolor = black /items = ("square") /position = (1%, 1%) / fontstyle = ("Arial", 1%, false, false, false, false, 5, 1) / txcolor = black /txbgcolor = black /items = ("both") /position = (1%, 1%) / fontstyle = ("Arial", 1%, false, false, false, false, 5, 1) / txcolor = black /txbgcolor = black ************************************************************************************************************** ************************************************************************************************************** LISTS ************************************************************************************************************** ************************************************************************************************************** Note: list contains the positions of the presented face positions in reversed order (dynamic list) (newest item is on list position 1) Note: list contains the itemnumbers of the presented audio words in reversed order (dynamic list) *********SOUNDS: AUDITORY*********************************** /items = (1, 2, 3, 4, 5, 6, 7, 8) /selectionmode = values.a_currenttarget / selectionrate = trial /items = (1, 2, 3, 4, 5, 6, 7, 8) /replace = true /not = (a_targetcounter) / selectionrate = trial /items = (1, 2, 3, 4, 5, 6, 7, 8) /replace = true / selectionrate = trial *********SQUARE: VISUAL*********************************** /items = (1, 2, 3, 4, 5, 6, 7, 8) /selectionmode = values.v_currenttarget / selectionrate = trial /items = (1, 2, 3, 4, 5, 6, 7, 8) /replace= true /not = (values.v_currenttarget) / selectionrate = trial /items = (1, 2, 3, 4, 5, 6, 7, 8) /replace = true / selectionrate = trial ************************************************************************************************************** ************************************************************************************************************** TRIALS ************************************************************************************************************** ************************************************************************************************************** *there are 3 types of main 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/target sound) 2. nontarget: trials that present stimuli that do not repeat the stimuli of n-trials before (= no target stimuli) 3. target: 3 different trials that present a mixture of Target and Nontarget stimuli a) trials that present visual but not auditory target b) trials that present auditory but not visual target c) trials that present visual and auditory targets / stimulustimes = [0 = fixationcross, square, startletter] / validresponse = (noresponse, 30, 38) / isvalidresponse = [ if ( (trial.start.response == 30 || trial.start.response == 38) && values.1response == 0 ) { values.1response = trial.start.response; values.1latency = trial.start.latency; }; if ( values.1response != 0 && (trial.start.response == 30 || trial.start.response == 38) && trial.start.response != values.1response ) { values.2response = trial.start.response; values.2latency = trial.start.latency; }; values.1response != 0 && values.2response != 0;] / iscorrectresponse = [values.1response == 0 && values.2response == 0] / ontrialbegin = [ trial.start.insertstimulustime(shape.eraser, parameters.stimulusPresentationtime); values.v_currenttarget = list.v_minus.item(values.N); values.a_currenttarget = list.a_minus.item(values.N); values.1response = 0; values.1latency = 0; values.2response = 0; values.2latency = 0; list.v_startcounter.nextvalue; list.a_startcounter.nextvalue; {if (list.v_startcounter.currentvalue == 1 || list.v_startcounter.currentvalue == 4 || list.v_startcounter.currentvalue == 6) values.xpos = 25}; {if (list.v_startcounter.currentvalue == 2 || list.v_startcounter.currentvalue == 7) values.xpos = 50}; {if (list.v_startcounter.currentvalue == 3 || list.v_startcounter.currentvalue == 5 || list.v_startcounter.currentvalue == 8) values.xpos = 75}; {if (list.v_startcounter.currentvalue == 1 || list.v_startcounter.currentvalue == 2 || list.v_startcounter.currentvalue == 3) values.ypos = 25}; {if (list.v_startcounter.currentvalue == 4 || list.v_startcounter.currentvalue == 5) values.ypos = 50}; {if (list.v_startcounter.currentvalue == 6 || list.v_startcounter.currentvalue == 7 || list.v_startcounter.currentvalue == 8) values.ypos = 75}; values.starttrialcounter += 1; values.trial_Hitv = 0; values.trial_Missv = 0; values.trial_CRv = 0; values.trial_FAv = 0; values.trial_Hita = 0; values.trial_Missa = 0; values.trial_CRa = 0; values.trial_FAa = 0; ] / ontrialend = [ trial.start.resetstimulusframes(); values.lastVitem = list.v_startcounter.currentvalue; values.lastAitem = text.startletter.currentitemnumber; if (values.N == 0){ values.v_currenttarget = values.lastVitem; values.a_currenttarget = values.lastAitem; }; list.v_minus.insertitem(values.lastVitem, 1); list.a_minus.insertitem(values.lastAitem, 1); values.v_position = list.v_startcounter.currentvalue; values.a_stimnumber = list.a_startcounter.currentvalue; {if (values.1response != 0 && values.2response == 0) values.latency = values.1latency else values.latency = trial.start.latency}; ] / beginresponsetime = 0 / trialduration = parameters.SOA /branch = [if (values.starttrialcounter < values.N) trial.start] / stimulustimes = [0 = fixationcross, square, nontargetletter] / validresponse = (noresponse, 30, 38) / isvalidresponse = [ if ( (trial.nontarget.response == 30 || trial.nontarget.response == 38) && values.1response == 0 ) { values.1response = trial.nontarget.response; values.1latency = trial.nontarget.latency; }; if ( values.1response != 0 && (trial.nontarget.response == 30 || trial.nontarget.response == 38) && trial.nontarget.response != values.1response ) { values.2response = trial.nontarget.response; values.2latency = trial.nontarget.latency; }; values.1response != 0 && values.2response != 0] / iscorrectresponse = [values.1response == 0 && values.2response == 0] / ontrialbegin = [ trial.nontarget.insertstimulustime(shape.eraser, parameters.stimulusPresentationtime); if (values.N > 0){ values.v_currenttarget = list.v_minus.item(values.N); values.a_currenttarget = list.a_minus.item(values.N); }; values.1response = 0; values.1latency = 0; values.2response = 0; values.2latency = 0; list.v_nontargetcounter.nextvalue; list.a_nontargetcounter.nextvalue; {if (list.v_nontargetcounter.currentvalue == 1 || list.v_nontargetcounter.currentvalue == 4 || list.v_nontargetcounter.currentvalue == 6) values.xpos = 25}; {if (list.v_nontargetcounter.currentvalue == 2 || list.v_nontargetcounter.currentvalue == 7) values.xpos = 50}; {if (list.v_nontargetcounter.currentvalue == 3 || list.v_nontargetcounter.currentvalue == 5 || list.v_nontargetcounter.currentvalue == 8) values.xpos = 75}; {if (list.v_nontargetcounter.currentvalue == 1 || list.v_nontargetcounter.currentvalue == 2 || list.v_nontargetcounter.currentvalue == 3) values.ypos = 25}; {if (list.v_nontargetcounter.currentvalue == 4 || list.v_nontargetcounter.currentvalue == 5) values.ypos = 50}; {if (list.v_nontargetcounter.currentvalue == 6 || list.v_nontargetcounter.currentvalue == 7 || list.v_nontargetcounter.currentvalue == 8) values.ypos = 75}; values.trial_Hitv = 0; values.trial_Missv = 0; values.trial_CRv = 0; values.trial_FAv = 0; values.trial_Hita = 0; values.trial_Missa = 0; values.trial_CRa = 0; values.trial_FAa = 0; ] / ontrialend = [ trial.nontarget.resetstimulusframes(); values.lastVitem = list.v_nontargetcounter.currentvalue; values.lastAitem = text.nontargetletter.currentitemnumber; list.v_minus.insertitem(values.lastVitem, 1); list.a_minus.insertitem(values.lastAitem, 1); values.v_position = list.v_nontargetcounter.currentvalue; values.a_stimnumber = list.a_nontargetcounter.currentvalue; if (values.1response == 30 || values.2response == 30){ values.trial_FAv = 1; values.v_FalseA += 1; } else { values.trial_CRv = 1; values.v_CorrReject += 1; }; if (values.1response == 38 || values.2response == 38){ values.trial_FAa = 1; values.a_FalseA += 1; } else { values.trial_CRa = 1; values.a_CorrReject += 1; }; if (values.1response != 0 && values.2response == 0) { values.latency = values.1latency; } else { values.latency = trial.nontarget.latency; }; ] / beginresponsetime = 0 / trialduration = parameters.SOA *****auditory target, but NOT visual target / stimulustimes = [0 = fixationcross, square, targetletter, letter_targetalert] / validresponse = (noresponse, 30, 38) / isvalidresponse = [ if ( (trial.a_target.response == 30 || trial.a_target.response == 38) && values.1response == 0 ) { values.1response = trial.a_target.response; values.1latency = trial.a_target.latency; }; if ( values.1response != 0 && (trial.a_target.response == 30 || trial.a_target.response == 38) && trial.a_target.response != values.1response ) { values.2response = trial.a_target.response; values.2latency = trial.a_target.latency; }; values.1response != 0 && values.2response != 0;] / iscorrectresponse = [values.1response == 38 && values.2response == 0] / ontrialbegin = [ trial.a_target.insertstimulustime(shape.eraser, parameters.stimulusPresentationtime); if (values.N > 0){ values.v_currenttarget = list.v_minus.item(values.N); values.a_currenttarget = list.a_minus.item(values.N); }; values.1response = 0; values.1latency = 0; values.2response = 0; values.2latency = 0; list.v_nontargetcounter.nextvalue; list.a_targetcounter.nextvalue; {if (list.v_nontargetcounter.currentvalue == 1 || list.v_nontargetcounter.currentvalue == 4 || list.v_nontargetcounter.currentvalue == 6) values.xpos = 25}; {if (list.v_nontargetcounter.currentvalue == 2 || list.v_nontargetcounter.currentvalue == 7) values.xpos = 50}; {if (list.v_nontargetcounter.currentvalue == 3 || list.v_nontargetcounter.currentvalue == 5 || list.v_nontargetcounter.currentvalue == 8) values.xpos = 75}; {if (list.v_nontargetcounter.currentvalue == 1 || list.v_nontargetcounter.currentvalue == 2 || list.v_nontargetcounter.currentvalue == 3) values.ypos = 25}; {if (list.v_nontargetcounter.currentvalue == 4 || list.v_nontargetcounter.currentvalue == 5) values.ypos = 50}; {if (list.v_nontargetcounter.currentvalue == 6 || list.v_nontargetcounter.currentvalue == 7 || list.v_nontargetcounter.currentvalue == 8) values.ypos = 75}; values.trial_Hitv = 0; values.trial_Missv = 0; values.trial_CRv = 0; values.trial_FAv = 0; values.trial_Hita = 0; values.trial_Missa = 0; values.trial_CRa = 0; values.trial_FAa = 0; ] / ontrialend = [ trial.a_target.resetstimulusframes(); values.lastVitem = list.v_nontargetcounter.currentvalue; values.lastAitem = text.targetletter.currentitemnumber; list.v_minus.insertitem(values.lastVitem, 1); list.a_minus.insertitem(values.lastAitem, 1); values.v_position = list.v_nontargetcounter.currentvalue; values.a_stimnumber = list.a_targetcounter.currentvalue; if (values.1response == 38 || values.2response == 38) { values.a_Hits += 1; values.trial_Hita = 1} else { values.a_Misses += 1; values.trial_Missa = 1; }; if (values.1response == 30 || values.2response == 30){ values.trial_FAv = 1; values.v_FalseA += 1; } else { values.trial_CRv = 1; values.v_CorrReject += 1; }; if (values.1response != 0 && values.2response == 0) { values.latency = values.1latency; } else { values.latency = trial.a_target.latency; }; ] / beginresponsetime = 0 / trialduration = parameters.SOA *****visual target, but NOT auditory target / stimulustimes = [0 = fixationcross, square, nontargetletter, square_targetalert] / validresponse = (noresponse, 30, 38) / isvalidresponse = [ if ( (trial.v_target.response == 30 || trial.v_target.response == 38) && values.1response == 0 ) { values.1response = trial.v_target.response; values.1latency = trial.v_target.latency; }; if ( values.1response != 0 && (trial.v_target.response == 30 || trial.v_target.response == 38) && trial.v_target.response != values.1response ) { values.2response = trial.v_target.response; values.2latency = trial.v_target.latency; }; values.1response != 0 && values.2response != 0;] / iscorrectresponse = [values.1response == 30 && values.2response == 0] / ontrialbegin = [ trial.v_target.insertstimulustime(shape.eraser, parameters.stimulusPresentationtime); if (values.N > 0){ values.v_currenttarget = list.v_minus.item(values.N); values.a_currenttarget = list.a_minus.item(values.N); }; values.1response = 0; values.1latency = 0; values.2response = 0; values.2latency = 0; list.v_targetcounter.nextvalue; list.a_nontargetcounter.nextvalue; {if (list.v_targetcounter.currentvalue == 1 || list.v_targetcounter.currentvalue == 4 || list.v_targetcounter.currentvalue == 6) values.xpos = 25}; {if (list.v_targetcounter.currentvalue == 2 || list.v_targetcounter.currentvalue == 7) values.xpos = 50}; {if (list.v_targetcounter.currentvalue == 3 || list.v_targetcounter.currentvalue == 5 || list.v_targetcounter.currentvalue == 8) values.xpos = 75}; {if (list.v_targetcounter.currentvalue == 1 || list.v_targetcounter.currentvalue == 2 || list.v_targetcounter.currentvalue == 3) values.ypos = 25}; {if (list.v_targetcounter.currentvalue == 4 || list.v_targetcounter.currentvalue == 5) values.ypos = 50}; {if (list.v_targetcounter.currentvalue == 6 || list.v_targetcounter.currentvalue == 7 || list.v_targetcounter.currentvalue == 8) values.ypos = 75}; values.trial_Hitv = 0; values.trial_Missv = 0; values.trial_CRv = 0; values.trial_FAv = 0; values.trial_Hita = 0; values.trial_Missa = 0; values.trial_CRa = 0; values.trial_FAa = 0; ] / ontrialend = [ trial.v_target.resetstimulusframes(); values.lastVitem = list.v_targetcounter.currentvalue; values.lastAitem = text.nontargetletter.currentitemnumber; list.v_minus.insertitem(values.lastVitem, 1); list.a_minus.insertitem(values.lastAitem, 1); values.v_position = list.v_targetcounter.currentvalue; values.a_stimnumber = list.a_nontargetcounter.currentvalue; if (values.1response == 30 || values.2response == 30) { values.v_Hits += 1; values.trial_Hitv = 1} else { values.v_Misses += 1; values.trial_Missv = 1; }; if (values.1response == 38 || values.2response == 38){ values.trial_FAa = 1; values.a_FalseA += 1; } else { values.trial_CRa = 1; values.a_CorrReject += 1; }; if (values.1response != 0 && values.2response == 0) { values.latency = values.1latency; } else { values.latency = trial.v_target.latency; }; ] / beginresponsetime = 0 / trialduration = parameters.SOA *****visual target AND auditory target / stimulustimes = [0 = fixationcross, square, targetletter, both_targetalert] / validresponse = (noresponse, 30, 38) / isvalidresponse = [ if ( (trial.av_target.response == 30 || trial.av_target.response == 38) && values.1response == 0 ) { values.1response = trial.av_target.response; values.1latency = trial.av_target.latency; }; if ( values.1response != 0 && (trial.av_target.response == 30 || trial.av_target.response == 38) && trial.av_target.response != values.1response ) { values.2response = trial.av_target.response; values.2latency = trial.av_target.latency; }; values.1response != 0 && values.2response != 0; ] / iscorrectresponse = [values.1response !=0 && values.2response != 0] / ontrialbegin = [ trial.av_target.insertstimulustime(shape.eraser, parameters.stimulusPresentationtime); if (values.N > 0){ values.v_currenttarget = list.v_minus.item(values.N); values.a_currenttarget = list.a_minus.item(values.N); }; values.1response = 0; values.1latency = 0; values.2response = 0; values.2latency = 0; list.v_targetcounter.nextvalue; list.a_targetcounter.nextvalue; {if (list.v_targetcounter.currentvalue == 1 || list.v_targetcounter.currentvalue == 4 || list.v_targetcounter.currentvalue == 6) values.xpos = 25}; {if (list.v_targetcounter.currentvalue == 2 || list.v_targetcounter.currentvalue == 7) values.xpos = 50}; {if (list.v_targetcounter.currentvalue == 3 || list.v_targetcounter.currentvalue == 5 || list.v_targetcounter.currentvalue == 8) values.xpos = 75}; {if (list.v_targetcounter.currentvalue == 1 || list.v_targetcounter.currentvalue == 2 || list.v_targetcounter.currentvalue == 3) values.ypos = 25}; {if (list.v_targetcounter.currentvalue == 4 || list.v_targetcounter.currentvalue == 5) values.ypos = 50}; {if (list.v_targetcounter.currentvalue == 6 || list.v_targetcounter.currentvalue == 7 || list.v_targetcounter.currentvalue == 8) values.ypos = 75}; values.trial_Hitv = 0; values.trial_Missv = 0; values.trial_CRv = 0; values.trial_FAv = 0; values.trial_Hita = 0; values.trial_Missa = 0; values.trial_CRa = 0; values.trial_FAa = 0; ] / ontrialend = [ trial.av_target.resetstimulusframes(); values.lastVitem = list.v_targetcounter.currentvalue; values.lastAitem = text.targetletter.currentitemnumber; list.v_minus.insertitem(values.lastVitem, 1); list.a_minus.insertitem(values.lastAitem, 1); values.v_position = list.v_targetcounter.currentvalue; values.a_stimnumber = list.a_targetcounter.currentvalue; if (values.1response == 30 || values.2response == 30) { values.v_Hits += 1; values.trial_Hitv = 1} else { values.v_Misses += 1; values.trial_Missv = 1; }; if (values.1response == 38 || values.2response == 38) { values.a_Hits += 1; values.trial_Hita = 1} else { values.a_Misses += 1; values.trial_Missa = 1; }; if (values.1response != 0 && values.2response == 0) { values.latency = values.1latency; } else { values.latency = trial.av_target.latency; }; ] / beginresponsetime = 0 / trialduration = parameters.SOA ************************************************************************************************************** ************************************************************************************************************** BLOCKS ************************************************************************************************************** ************************************************************************************************************** *****************INSTRUCTION BLOCKS******************************************************************* ATTENTION: PRACTICE BLOCKS (1) This block sets the beginning N value for practice trials (here: values.N = parameters.StartN) (2) runs original instructions 1-9, if more/fewer than three N examples are given adjust: /trials = [1-X.....] / trials = [1-9 = Nbackinstruct_starttrial] / recorddata = false /trials = [1 = repeatpractice] / recorddata = false / branch = [ if (trial.repeatpractice.response == 21 && !monkey.monkeymode) { block.practice_d_ntask; } else { block.Practiceblock_end; }; ] / screencolor = black / trials = [1 = Practice_endtrial] / recorddata = false ****************************** Practice Blocks: nonadaptive ****************************** * Practice Blocks give feedback and do NOT record data * Block starts with N start-trials that cannot present targets yet * in remaining 10 trials: ratio nontargets : v_target : a_target : av_target: 5: 2: 2: 1 / skip = [ parameters.runPractice == 0; ] / onblockbegin = [ values.N = list.nextN_practice.nextvalue; values.TotalBlocks += 1; values.starttrialcounter = 0; values.v_currenttarget = 0; values.a_currenttarget = 0; list.v_minus.reset(); values.lastIndex = 1; expressions.fillVlist; list.a_minus.reset(); values.lastIndex = 1; expressions.fillAlist; values.v_Hits = 0; values.v_FalseA = 0; values.v_Misses = 0; values.v_CorrReject = 0; values.a_Hits = 0; values.a_FalseA = 0; values.a_Misses = 0; values.a_CorrReject = 0; ] / trials = [ 1 = practice_expinstructiontrial; 2 = start; 3 - 12 = noreplace(nontarget, nontarget, nontarget, nontarget, nontarget, v_target, v_target, a_target, a_target, av_target) ] / onblockend = [ values.v_TotalHits = 0; values.v_TotalFA = 0; values.a_TotalHits = 0; values.a_TotalFA = 0; values.DV = 0; ] / screencolor = (0, 0, 0) / recorddata = false / postinstructions = (BlockSummary_practice) / branch = [ if (values.TotalBlocks >= list.nextN_practice.itemcount) { values.TotalBlocks = 0; block.RepeatPractice; } else { block.practice_d_ntask; }; ] ****************************** Test Blocks: nonadaptive ****************************** / trials = [1 = StartExp_trial] / recorddata = false / onblockbegin = [ values.v_TotalFA = 0; values.v_TotalHits = 0; values.a_TotalFA = 0; values.a_TotalHits = 0; values.TotalBlocks = 0; values.DV = 0; ] * Block starts with N start-trials that cannot present targets yet (not included in performance analyses) * in remaining 20 trials: ratio nontargets : v_target : a_target : av_target: 10 : 4 : 4: 2 = 5: 2: 2: 1 / preinstructions = (ExpInstructions) / onblockbegin = [ values.N = list.nextN.nextvalue; list.v_minus.reset(); values.lastIndex = 1; expressions.fillVlist; list.a_minus.reset(); values.lastIndex = 1; expressions.fillAlist; values.TotalBlocks += 1; values.starttrialcounter = 0; values.v_currenttarget = 0; values.a_currenttarget = 0; values.v_Hits = 0; values.v_FalseA = 0; values.v_Misses = 0; values.v_CorrReject = 0; values.a_Hits = 0; values.a_FalseA = 0; values.a_Misses = 0; values.a_CorrReject = 0; ] / trials = [1 = start; 2 - 21 = noreplace(nontarget, nontarget, nontarget, nontarget, nontarget, v_target, v_target, a_target, a_target, av_target)] / onblockend = [ values.v_TotalHits = values.v_TotalHits + values.v_Hits; values.a_TotalHits = values.a_TotalHits + values.a_Hits; values.v_TotalFA = values.v_TotalFA + values.v_FalseA; values.a_TotalFA = values.a_TotalFA + values.a_FalseA; values.DV = (((values.v_TotalHits - values.v_TotalFA) + (values.a_TotalHits - values.a_TotalFA))/2)/ values.TotalBlocks ] / branch = [ if (values.TotalBlocks < list.nextN.itemcount){ block.d_ntask; } else { block.EndExp; }; ] / screencolor = (0, 0, 0) / trials = [1 = EndExp_trial] ************************************************************************************************************** ************************************************************************************************************** EXPERIMENT ************************************************************************************************************** ************************************************************************************************************** *After running the initial instructions, participants work through practice blocks for N = 2 to N = 4 * After practice, participants work through 3 blocks for each of the following level of N: N = 2, N = 3, N = 4 /onexptbegin = [if (parameters.Debugmode == 1) {text.letter_targetalert.textcolor = red; text.square_targetalert.textcolor = yellow; text.both_targetalert.textcolor = green}] / blocks = [ 1 = Nbackinstruct_start; 2 = practice_d_ntask; 3 = StartExp; 4 = d_ntask; ] /onexptend = [values.completed = 1] ************************************************************************************************************** End of File **************************************************************************************************************