___________________________________________________________________________________________________________________ n-back task for the touchscreen ___________________________________________________________________________________________________________________ Script Author: Katja Borchert, Ph.D. (katjab@millisecond.com) for Millisecond Software, LLC Date: 04-26-2022 last updated: 04-10-2024 by K. Borchert (katjab@millisecond.com) for Millisecond Software, LLC Script Copyright © 04-10-2024 Millisecond Software ___________________________________________________________________________________________________________________ BACKGROUND INFO ___________________________________________________________________________________________________________________ This script implements a touchscreen version of a simple nback task, a measure of visual working memory. The implemented task uses a suit of ordinary playing cards as stimuli. Researchers can set the level of of n-back task to run as well as the number of trials and ratio of targets to non-targets. The implemented script only runs the selected nback level but could be customized to run more levels if needed. This script is designed for the touchscreen but adapts to mouse use on non-touchscreens. Researchers can select to run the task with an absolute screen size to ensure that distances stay the same across devices. The default settings are optimized for ipad touchscreens. See section Editable Parameters for more info. //References// //1-back procedure with 42 trials and using cards as stimuli:// Maruff P, Thomas E, Cysique L, Brew B, Collie A, Snyder P, Pietrzak RH. Validity of the CogState brief battery: relationship to standardized tests and sensitivity to cognitive impairment in mild traumatic brain injury, schizophrenia, and AIDS dementia complex. Arch Clin Neuropsychol. 2009 Mar;24(2):165-78. doi: 10.1093/arclin/acp010. Epub 2009 Mar 25. PMID: 19395350. //general reference for n-back procedure: Jaeggi, Susanne M.; Studer-Luethi, Barbara; Buschkuehl, Martin; Su, Yi-Fen; Jonides, John; Perrig, Walter J. (2010). The relationship between n-back performance and matrix reasoning - implications for training and transfer. Intelligence, 38, 625–635. ___________________________________________________________________________________________________________________ TASK DESCRIPTION ___________________________________________________________________________________________________________________ Participants get presented with a deck of cards (consisting of the regular 4 suits - 13 cards per suit) and the cards will be turned over one by one. Depending on the level of N tested (editable parameter), participants are asked to decide for each card whether the current card: N=0: is the pre-defined target card (by default, it's the 10 of diamonds in this script) N=1: is the same as the card before it (= target) N=2: is the same as the card 2-cards before it (= target) etc. If they think the current card is a target, they should press the 'Yes' response button. If they think the card is not a target, they should press the 'No' response button. Participants are instructed to respond as quickly and accurately as they can. Once a response button is pressed, the button is highlighted in yellow. After the card has been presented for 2seconds an animation is started that 'returns' the card back to the stack. The next trial is initiated once participants press a 'Home Button'. The 'Home Button' is implemented to ensure that response fingers are roughly equally distanced from both the no and yes button for each trial. __________________________________________________________________________________________________________________ DURATION ___________________________________________________________________________________________________________________ the default set-up of the script takes appr. 4 minutes to complete ___________________________________________________________________________________________________________________ DATA FILE INFORMATION ___________________________________________________________________________________________________________________ The default data stored in the data files are: (1) Raw data file: 'singlenbacktask_shapes_raw.iqdat' (a separate file for each participant) build: The specific Inquisit version used (the 'build') that was run computer.platform: the platform the script was run on (win/mac/ios/android) date, time: date and time script was run subject, group, with the current subject/groupnumber session: with the current session id blockcode, blocknum: the name and number of the current block (built-in Inquisit variable) trialcode, trialnum: the name and number of the currently recorded trial (built-in Inquisit variable) Note: trialnum is a built-in Inquisit variable; it counts all trials run; even those that do not store data to the data file such as feedback trials. Thus, trialnum may not reflect the number of main trials run per block. //Play Setup: (parameter) runAbsoluteSizes: true (1) = should run absolutely sized canvas (see parameters- canvasHeight_inmm) false (0) = should use proportionally sized canvas (uses width = 43*screenHeight) canvasAdjustments: NA: not applicable => parameters- runAbsoluteSize was set to 'false' 0: parameters- runAbsoluteSize was set to 'true' and screen size was large enough 1: parameters- runAbsoluteSize was set to 'true' BUT screen size was too small and adjustments had to be made playareaHeight_inmm: the width of the play area in mm playareaWidth_inmm: the height of the play area in mm display.canvasHeight: the height of the active canvas ('playarea') in pixels display.canvasWidth: the width of the active canvas ('playarea') in pixels px_per_mm: the conversion factor to convert pixel data into mm-results for the current monitor (Note: the higher resolution of the current monitor the more pixels cover the same absolute screen distance) This factor is needed if you want to convert pixel data into absolute mm data or the other way around distance_homeButton_responsebutton_inmm: the calculated distance (in mm) between center of homeButton and center of one of the response buttons N: the current level N tested blockCounter: the total number of experimental blocks run trialCounter: counts the target and nontarget trials per block (Note: start trials are excluded from count) starttrialcounter: keeps track of how many start trials have been run stimulusitem.1: the shape presented stimulusnumber.1: the item number of the presented shape currenttarget: the item number of the current target //custom DVs for main nback trials// rsp: the Response of the participant yes/no/NR = no response ACC: the correctness of the response (1 = correct; 0 = otherwise) RT: how fast a participant responded within the given timeframe, if at all (in ms) no responses => empty list.blockACC.mean: proportion correct during the current block (start trials are excluded from block ACC assessment by design) //built-in DVs (will not record any useable data for the main nback trials) response: the Response of the participant correct: the correctness of the response (1 = correct; 0 = otherwise) latency: how fast a participant responded within the given timeframe, if at all (in ms) no responses = the entire trialduration (2) Summary data file: 'singlenbacktask_shapes_summary*.iqdat' (a separate file for each participant) inquisit.version: Inquisit version run computer.platform: the platform the script was run on (win/mac/ios/android) startDate: date script was run startTime: time script was started subjectid: assigned subject id number groupid: assigned group id number sessionid: assigned session id number elapsedTime: time it took to run script (in ms); measured from onset to offset of script completed: 0 = script was not completed (prematurely aborted); 1 = script was completed (all conditions run) //Play Setup: (parameter) runAbsoluteSizes: true (1) = should run absolutely sized canvas (see parameters- canvasHeight_inmm) false (0) = should use proportionally sized canvas (uses width = 43*screenHeight) canvasAdjustments: NA: not applicable => parameters- runAbsoluteSize was set to 'false' 0: parameters- runAbsoluteSize was set to 'true' and screen size was large enough 1: parameters- runAbsoluteSize was set to 'true' BUT screen size was too small and adjustments had to be made playareaHeight_inmm: the width of the play area in mm playareaWidth_inmm: the height of the play area in mm display.canvasHeight: the height of the active canvas ('playarea') in pixels display.canvasWidth: the width of the active canvas ('playarea') in pixels px_per_mm: the conversion factor to convert pixel data into mm-results for the current monitor (Note: the higher resolution of the current monitor the more pixels cover the same absolute screen distance) This factor is needed if you want to convert pixel data into absolute mm data or the other way around distance_homeButton_responsebutton_inmm: the calculated distance (in mm) between center of homeButton and center of one of the response buttons //Parameter Settings: levelN: level of N tested blocks_pertest: number of test blocks run trials_perblock: number of trials per block to run numberTargetTrials_perblock: number of target trials per block numberNonTargetTrials_perblock: number of nontarget trials per block ratio_TtoNT: ratio 'Target:Nontarget' The following summary variables are only based on performance on trial.target/trial.nontarget (excludes trial.start) propCorrect_overall: overall proportion correct (across all test blocks), across target and nontarget trials countNR_overall: the number of no responses (timeouts) across target and nontarget trials meanCorrRT_overall: overall mean correct response time (in ms), across target and nontarget trials ////////////The following summary variables are only used if more than one test block are run://////// //per block: propCorrect_block1: block1 proportion correct, across target and nontarget trials countNR_block1: the number of no responses (timeouts) across target and nontarget trials during block1 meanCorrRT_block1: block1 mean correct response time (in ms), across target and nontarget trials //block2 and higher //Note: as block1 could be used as practice, 'block2' uses all data collected after block1 propCorrect_block2: block2 proportion correct, across target and nontarget trials countNR_block2: the number of no responses (timeouts) across target and nontarget trials during block2 meanCorrRT_block2: block2 mean correct response time (in ms), across target and nontarget trials ___________________________________________________________________________________________________________________ EXPERIMENTAL SET-UP ___________________________________________________________________________________________________________________ Test: by default this script runs 1 testblock (Editable Parameter) with 42+ trials each (Editable Parameter) using the 13 clubs cards (editable*). The script provides a brief resttrial (self-paced) after each block. => + 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 => Of the actual 42 experimental trials, half of the trials present a target (Editable Parameter) - The computer selects randomly a) whether it is a target trial or not and b) what card to show if it is not a target trial (cards are selected randomly with replacement with the constraint that it cannot be the current target stim) Trial Information: -> each trial starts with a HomeButton press (reminder presented after 2s) -> cards get uncovered for 2s, wait for response; if response is made, the response button is highlighted to give response feedback, card animation is started after 2s regardless of response -> card animation for 1000ms If the homebutton is pressed at the end of the animation trial, the next card is uncovered immediately. ___________________________________________________________________________________________________________________ STIMULI ___________________________________________________________________________________________________________________ 52 cards, see section Editable Stimuli By default, only the 13 club cards are currently used for the task. However, you can easily edit the list of cards. Note: A longer list likely makes the nback less challenging as random repeats of nontarget cards (in nontarget positions) are less likely to happen with a larger selection pool. Thus, any repeated cards is much more likely to be a target. ___________________________________________________________________________________________________________________ INSTRUCTIONS ___________________________________________________________________________________________________________________ provided by Millisecond Software - can be edited under section Editable Instructions ___________________________________________________________________________________________________________________ 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: