Return to the AX Continuous Performance Test (AX-CPT) page
___________________________________________________________________________________________________________________	

						AX Continuous Performance Task (AX-CPT)
___________________________________________________________________________________________________________________	

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

Script Copyright © 11-08-2019 Millisecond Software

___________________________________________________________________________________________________________________
BACKGROUND INFO 	
___________________________________________________________________________________________________________________	
This script implements the AX-CPT procedure, a test of sustained and selective attention.

Reference:

Marcora, S.M,  Staiano, W. & Manning, V. (2009). Mental fatigue impairs physical performance in humans.
J Appl Physiol, 106: 857–864

___________________________________________________________________________________________________________________
TASK DESCRIPTION	
___________________________________________________________________________________________________________________
Participants view sequences of letters: cue-distractor-distractor-probe and have to decide if 
the probe is a target (cue = A, probe = X) or not. If the probe is a target, participants
press the 'E'; if it's not a target they press the 'I' key.

___________________________________________________________________________________________________________________	
DURATION 
___________________________________________________________________________________________________________________	
the default set-up of the script takes appr. 20 minutes to complete

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

(1) Raw data file: 'ax_cpt_rawdata.iqdat' (a separate script 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
script.sessionid:					with the current session id

nr_trials:							number of trials to run in the predetermined time with the predetermined stimulus durations
nr_targettrials_AX:				number of AX trials to run for the predetermined duration (default: for 20 minutes
nr_targettrials_AY:				number of AY trials to run for the predetermined duration (default: for 20 minutes)
nr_nontargettrials_BX:				number of BX trials to run for the predetermined duration (default: for 20 minutes)
nr_nontargettrials_BY:				number of BY trials to run for the predetermined duration (default: for 20 minutes)

phase1trials:						last trial run for critical phase 1 time period (default: trials run in the first 5 minutes)
										Note: for a 20 minutes task (200 trials) -> trials 1-50 are counted towards phase 1
										
phase3trials:						trial numbers higher than this number count towards trials run for critial phase 3 (default: trials run in last 5 minutes)
										Note: for a 20 minutes task (200 trials) -> trials 151-200 are counted towards phase 3
										
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.
									
counttrials:						count of the trialsequences
trialtype:							1 = AX (target); 2 = AY; 3 = BX; 4 = BY

phase:							1 = trials run in the first 5 minutes (default; see parameters.targetphaseduration_min)
								2 = trials run in the middle
								3 = trials run in the last 5 minutes (default; see parameters.targetphaseduration_min)
								
cue:								stores the letter presented as the cue
probe:							stores the letter presented as the probe
distractor1:						stores the letter presented as the distractor1
distractor2:						stores the letter presented as the distractor2

stimulusitem:						the presented stimuli in order of trial presentation
										Note: only statically presented items
										
response:						the participant's response (scancode of response key)
									18 = E = target
									23 = I = nontarget
									
correct:							the correctness of the response (1 = correct; 0 = incorrect)
latency: 							the response latency (in ms); measured from onset of probe (2nd red letter)


(2) Summary data file: 'ax_cpt_summary.iqdat' (Inquisit Lab: one data file for all participants)

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

countcorrect:						counts all correct responses
percentcorrect:					overall percent correct 
meanRT:							overall mean latency of correct responses
probHits: 						proportion hits overall
propHits_phase1: 					proportion hits in phase1 (first 5 minutes, default; see parameters.targetphaseduration_min)
propHits_phase2:					proportion hits in phase2
propHits_phase3:					proportion hits in phase3 (last 5 minutes, default; see parameters.targetphaseduration_min)

nr_trials:							number of trials to run in the predetermined time with the predetermined stimulus durations
nr_targettrials_AX:				number of AX trials to run for the predetermined duration (default: for 20 minutes)
nr_targettrials_AY:				number of AY trials to run for the predetermined duration (default: for 20 minutes)
nr_targettrials_BX:				number of BX trials to run for the predetermined duration (default: for 20 minutes)
nr_targettrials_BY:				number of BY trials to run for the predetermined duration (default: for 20 minutes)

phase1trials:						last trial run for critical phase 1 time period (default: trials run in the first 5 minutes)
										Note: for a 20 minutes task (200 trials) -> trials 1-50 are counted towards phase 1
										
phase3trials:						trial numbers higher than this number count towards trials run for critial phase 3 (default: trials run in last 5 minutes)
										Note: for a 20 minutes task (200 trials) -> trials 151-200 are counted towards phase 3
										
feedbacktrialinterval:				number of trials that are run before feedback is given for the predetermined feedback interval

___________________________________________________________________________________________________________________	
EXPERIMENTAL SET-UP 
___________________________________________________________________________________________________________________	
(I) Task: 
20minutes; each trialsequences takes 6000ms => Total of 200 trials (target: 140; notarget= 3 x 20)
=> order of the trialsequences is randomly determined

NOTE: the task duration in this script is determined by the number of trial sequences that span the predetermined taskduration_min 
(e.g. 20 min)
given the default letterduration (300ms) and ISI (1200ms) (each trial sequence: cue -> distractor -> distractor -> probe => 6000ms).
Trialnumber instead of timing is used to determine the length of the task to ensure that the predetermined probability of targettrials 
and nontargettrials is indeed run.

(II) Types of Trials:
70% Target Trial Sequences AX
10% NoTarget Trial Sequences AY
10% NoTarget Trial Sequences BX
10% No target Trial Sequences BY

(III) Default Trial Sequence:
Cue (300ms)-> ISI(1200ms)->Distractor(300ms)->ISI(1200ms)->Distractor(300ms)->ISI(1200ms)->Probe(300ms)->ISI(1200ms) => 
Response measured from onset of Probe; time to respond until end of ISI.
Probe is presented for 300ms even if response occurs before probe is erased.

To be able to give errorfeedback immediately (or almost immediately) following the response; the ISI after the probe
is handled by a separate trial. If no response occurs, the error feedback adds about 50ms to the trialduration

(IV) Performance Feedback:
Performance Feedback is presented after every 10min (default) -> after every 100 trials 

Target Phases (counts hits for first and last 15 minutes of the test):
Phase 1 (for 20 minutes test): first 5 minutes -> trials 1-50
Phase 3 (for 20 minutes test): last 5 minutes -> trials 151-200

___________________________________________________________________________________________________________________	
STIMULI
___________________________________________________________________________________________________________________
Letters:
* Default Font: Arial
* Size: can be set under section Editable Parameter (Size is proportional to monitor height)
* Cue and Probe letters: red on black
* Distractors: white on black
Errorfeedback: 50ms beep (can be edited under section Editable Stimuli)

___________________________________________________________________________________________________________________	
INSTRUCTIONS 
___________________________________________________________________________________________________________________
are presented in the form of an html file. The html file can be edited directly to change
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:

/taskduration_min:					duration of task in minutes (default: 20 minutes)
/feedbackintervals_min:				feedback intervals in min (default: every 10 minutes)
/targetphaseduration_min:				the duration of the critical phases in minutes (default: first 5 minutes and last 5 minutes)
/letterduration_ms:					the duration of the letters in ms (default: 300ms)
/isi_ms:								the duration of the interstimulusintervals (offset of one letter to onset of next) in ms (default: 1200ms)

!NOTE: 
the duration of this script is determined by the number of trial sequences that span the predetermined taskduration_min (e.g. 20 min)
given the default letterduration (300ms) and ISI (1200ms) (each trial sequence: cue -> distractor -> distractor -> probe => 6000ms).
Trialnumber instead of timing is used to determine the length of the task to ensure that the predetermined probability of targettrials 
and nontargettrials is indeed run.

Taskduration_min should be chosen carefully for the specified trialdurations (letterduration and ISI) to
ensure that integer values are obtained for total number of trials and number of targettrials and non-targettrials.

This script is set up for taskduration = 20 min for the default letterduration (300ms) and ISI (1200ms)
and the default probabilities of target (0.7) and nontarget trials (0.1 x 3)

/prob_targettrials_AX:					frequency of targettrials AX
/prob_nontargettrials_BX:				frequency of BX no target trials
/prob_nontargettrials_BY:				frequency of BY no target trials
/prob_nontargettrials_AY:				frequency of AY no target trials

/letterheight:							sets the letterheight in proportion of the canvas height (default: 5%)
/performancefeedbackduration:			sets the duration of the performance feedback in ms (default: 5000ms)