User Manual: Inquisit Cognitive Demand Battery


___________________________________________________________________________________________________________________	

								*Cognitive Demand Battery (CDB)*
								*Batch Script - runs German Instruction scripts*
___________________________________________________________________________________________________________________	


Script Author: Katja Borchert, Ph.D. (katjab@millisecond.com) for Millisecond Software, LLC
Date: 06-04-2024
last updated:  06-04-2024 by K. Borchert (katjab@millisecond.com) for Millisecond Software, LLC

Script Copyright © 06-04-2024 Millisecond Software

___________________________________________________________________________________________________________________
BACKGROUND INFO 	
___________________________________________________________________________________________________________________
This script implements Millisecond Software's version of the Cognitive Demand Battery (CDB) by 
Kennedy et al (2008). The CDB runs : Serial 3s and Serial 7s subtraction tasks, 
a Rapid Visual Information Processing (RVIP) task and a ‘mental fatigue’ Visual Analog Scale.

All tasks can be run with the mouse or touch input.

Reference:
											
///Cognitive Demand Battery (CDB):
Kennedy, D. O., Haskell, C. F., Robertson, B., Reay, J., Brewster-Maund, C., Luedemann, J., 
Maggini, S., Ruf, M., Zangara, A., & Scholey, A. B. (2008). Improved cognitive performance and 
mental fatigue following a multi-vitamin and mineral supplement with added guaraná ( Paullinia cupana). 
Appetite, 50(2), 506–513. https://doi.org/10.1016/j.appet.2007.10.007
__________________________________________________________________________________________________________________	
DURATION 
___________________________________________________________________________________________________________________	
the default set-up of the script takes appr. 10 minutes to complete
													
___________________________________________________________________________________________________________________	
OVERVIEW
___________________________________________________________________________________________________________________	

This batch script automatically calls 
/ file = "cdb_serial7_mi.iqjs"
/ file = "cdb_serial3_mi.iqjs"
/ file = "cdb_rvip_mi.iqjs"
/ file = "cdb_vas.iqjs"
in sequence




___________________________________________________________________________________________________________________	

										*SERIAL 7 SUBTRACTION TASK*
										as part of the The Cognitive Demand Battery (CDB)										
										(German instructions)
___________________________________________________________________________________________________________________	

Script Author: Katja Borchert, Ph.D. (katjab@millisecond.com) for Millisecond Software, LLC
Date: 06-03-2024
last updated:  06-03-2024 by K. Borchert (katjab@millisecond.com) for Millisecond Software, LLC

Script Copyright © 06-03-2024 Millisecond Software

German translations provided by K. Borchert for Millisecond Software

___________________________________________________________________________________________________________________
BACKGROUND INFO 	
___________________________________________________________________________________________________________________	
This script implements a Serial 7 Subtraction Task.
The Serial Subtraction Task is a working memory performance task of the 'updating' category.
The implemented procedure is based on Kennedy & Scholey (2000) and adapted to run as 
part of the Cognitive Demand Battery (CDB) (Kennedy et al, 2008).

References:
/////Serial Substraction Task procedure:
Kennedy, D.O. & · Andrew B. Scholey, A.B. (2000). Glucose administration, heart rate and cognitive performance:
effects of increasing mental effort. Psychopharmacology (2000) 149:63–71.

Note: in this script, the Serial Subtraction task uses written input instead of oral input

///Cognitive Demand Battery (CDB):
Kennedy, D. O., Haskell, C. F., Robertson, B., Reay, J., Brewster-Maund, C., Luedemann, J., 
Maggini, S., Ruf, M., Zangara, A., & Scholey, A. B. (2008). Improved cognitive performance and 
mental fatigue following a multi-vitamin and mineral supplement with added guaraná ( Paullinia cupana). 
Appetite, 50(2), 506–513. https://doi.org/10.1016/j.appet.2007.10.007



___________________________________________________________________________________________________________________
TASK DESCRIPTION
___________________________________________________________________________________________________________________	
Participants are given a randomly generated 3 digit number between 900-999 and are asked to subtract 7 (default)
as often as they can within a 2 minute time frame (adjustable).	
Participants enter their solution by selecting digit buttons 0-9 with the mouse.
Responses can be corrected before submit.	
Correct solutions are based on the last entered number (whether or not that response was correct).								  

___________________________________________________________________________________________________________________	
DURATION 
___________________________________________________________________________________________________________________	
the default set-up of the script takes appr. 2 minutes to complete
(duration can be edited under section Editable Parameters)

___________________________________________________________________________________________________________________	
DATA OUTPUT DICTIONARY
___________________________________________________________________________________________________________________
The fields in the data files are:

(1) Raw data file: 'serialsubtractiontask_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.	
											
currentNumber:					contains the current start Number to be presented 
(parameter) TargetDiff:			contains the target difference between numbers (here: 3)

correctSolution:				stores the current correct solution
								Note: the current correct solution number is generated based on the last proposed solution.
								Thus if the last proposed solution was incorrect, the new correct solution is
								based on the incorrect proposed solution
										
proposedSolution:				stores the entered proposed solution for the current subtraction
correct:						the correctness of the response (1 = correct; 0 = incorrect)
latency: 						the response latency (in ms); measured from onset of response dial
countResponses:					counts the number of given responses
countErrors:					counts the number of errors made


(2) Summary data file: 'serialsubtractiontask_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)						
									
(parameter) TargetDiff:			contains the target difference between numbers (here: 7)									
roundCount:						counts the number of rounds run (default: 1 round with difference = 7)
countResponses:					counts the number of given responses
countErrors:					counts the number of errors made

___________________________________________________________________________________________________________________	
EXPERIMENTAL SET-UP 
___________________________________________________________________________________________________________________	

Participants are asked to perform a Serial7 task with a randomly drawn number from 800-999.

Participants are given a target number and are asked to start subtracting 3 from it in their heads. 
They enter their solution to each new subtraction via a response dial.
The response is evaluated in regard to the previously entered solution (whether or not that was a correct
solution).
The task is over after 2 minutes (default)

___________________________________________________________________________________________________________________	
STIMULI
___________________________________________________________________________________________________________________	
randomly generated 3 digit start numbers (generated without replacement across blocks) between 800-999

___________________________________________________________________________________________________________________	
INSTRUCTIONS 
___________________________________________________________________________________________________________________	
to edit instructions, go to 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:

/targetDiff:					the target difference btw. numbers (here: 3)
/taskDuration:					task duration in ms (default: 120000ms = 2 min)					
/circleProportion:				proportion of canvas height used for the circle radius of response buttons (default: 0.3)



___________________________________________________________________________________________________________________	

										*SERIAL 3 SUBTRACTION TASK*
										as part of the The Cognitive Demand Battery (CDB)
										(German instructions)
___________________________________________________________________________________________________________________	

Script Author: Katja Borchert, Ph.D. (katjab@millisecond.com) for Millisecond Software, LLC
Date: 06-03-2024
last updated:  06-03-2024 by K. Borchert (katjab@millisecond.com) for Millisecond Software, LLC

Script Copyright © 06-03-2024 Millisecond Software

German translations provided by K. Borchert for Millisecond Software

___________________________________________________________________________________________________________________
BACKGROUND INFO 	
___________________________________________________________________________________________________________________	
This script implements a Serial 3 Subtraction Task.
The Serial Subtraction Task is a working memory performance task of the 'updating' category.
The implemented procedure is based on Kennedy & Scholey (2000) and adapted to run as 
part of the Cognitive Demand Battery (CDB) (Kennedy et al, 2008).

References:
/////Serial Substraction Task procedure:
Kennedy, D.O. & · Andrew B. Scholey, A.B. (2000). Glucose administration, heart rate and cognitive performance:
effects of increasing mental effort. Psychopharmacology (2000) 149:63–71.

Note: in this script, the Serial Subtraction task uses written input instead of oral input

///Cognitive Demand Battery (CDB):
Kennedy, D. O., Haskell, C. F., Robertson, B., Reay, J., Brewster-Maund, C., Luedemann, J., 
Maggini, S., Ruf, M., Zangara, A., & Scholey, A. B. (2008). Improved cognitive performance and 
mental fatigue following a multi-vitamin and mineral supplement with added guaraná ( Paullinia cupana). 
Appetite, 50(2), 506–513. https://doi.org/10.1016/j.appet.2007.10.007



___________________________________________________________________________________________________________________
TASK DESCRIPTION
___________________________________________________________________________________________________________________	
Participants are given a randomly generated 3 digit number between 900-999 and are asked to subtract 7 (default)
as often as they can within a 2 minute time frame (adjustable).	
Participants enter their solution by selecting digit buttons 0-9 with the mouse.
Responses can be corrected before submit.	
Correct solutions are based on the last entered number (whether or not that response was correct).								  

___________________________________________________________________________________________________________________	
DURATION 
___________________________________________________________________________________________________________________	
the default set-up of the script takes appr. 2 minutes to complete
(duration can be edited under section Editable Parameters)

___________________________________________________________________________________________________________________	
DATA OUTPUT DICTIONARY
___________________________________________________________________________________________________________________
The fields in the data files are:

(1) Raw data file: 'serialsubtractiontask_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.	
											
currentNumber:					contains the current start Number to be presented 
(parameter) TargetDiff:			contains the target difference between numbers (here: 3)

correctSolution:				stores the current correct solution
								Note: the current correct solution number is generated based on the last proposed solution.
								Thus if the last proposed solution was incorrect, the new correct solution is
								based on the incorrect proposed solution
										
proposedSolution:				stores the entered proposed solution for the current subtraction
correct:						the correctness of the response (1 = correct; 0 = incorrect)
latency: 						the response latency (in ms); measured from onset of response dial
countResponses:					counts the number of given responses
countErrors:					counts the number of errors made


(2) Summary data file: 'serialsubtractiontask_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)						
									
(parameter) TargetDiff:			contains the target difference between numbers (here: 7)									
roundCount:						counts the number of rounds run (default: 1 round with difference = 7)
countResponses:					counts the number of given responses
countErrors:					counts the number of errors made

___________________________________________________________________________________________________________________	
EXPERIMENTAL SET-UP 
___________________________________________________________________________________________________________________	

Participants are asked to perform a Serial3 task with a randomly drawn number from 800-999.

Participants are given a target number and are asked to start subtracting 3 from it in their heads. 
They enter their solution to each new subtraction via a response dial.
The response is evaluated in regard to the previously entered solution (whether or not that was a correct
solution).
The task is over after 2 minutes (default)

___________________________________________________________________________________________________________________	
STIMULI
___________________________________________________________________________________________________________________	
randomly generated 3 digit start numbers (generated without replacement across blocks) between 800-999

___________________________________________________________________________________________________________________	
INSTRUCTIONS 
___________________________________________________________________________________________________________________	
to edit instructions, go to 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:

/targetDiff:					the target difference btw. numbers (here: 3)
/taskDuration:					task duration in ms (default: 120000ms = 2 min)					
/circleProportion:				proportion of canvas height used for the circle radius of response buttons (default: 0.3)



___________________________________________________________________________________________________________________	

								*RAPID VISUAL INFORMATION PROCESSING (RVIP)*
								as part of the The Cognitive Demand Battery (CDB)
								(mouse/touchscreen input)
								
								German instructions
___________________________________________________________________________________________________________________	

Script Author: Katja Borchert, Ph.D. (katjab@millisecond.com) for Millisecond Software, LLC
last updated:  09-30-2024 by K. Borchert (katjab@millisecond.com) for Millisecond Software, LLC

Script Copyright ©  09-30-2024 Millisecond Software

German translations provided by K. Borchert for Millisecond Software

___________________________________________________________________________________________________________________
BACKGROUND INFO 	
___________________________________________________________________________________________________________________	
This script implements the Rapid Visual Information Processing Task (RVIP), a measures of processing speed
and performance. The implemented procedure is based on Wesnes & Wartburton (1984) and adapted to run as 
part of the Cognitive Demand Battery (CDB) (Kennedy et al, 2008).

References:

///RVIP Procedure:
Wesnes, K. & Wartburton, D.M (1984), Effects of scopolamine and nicotine on human rapid information 
processing performance.  Psychopharmacology, 82, 147-150.

///Cognitive Demand Battery (CDB):
Kennedy, D. O., Haskell, C. F., Robertson, B., Reay, J., Brewster-Maund, C., Luedemann, J., 
Maggini, S., Ruf, M., Zangara, A., & Scholey, A. B. (2008). Improved cognitive performance and 
mental fatigue following a multi-vitamin and mineral supplement with added guaraná ( Paullinia cupana). 
Appetite, 50(2), 506–513. https://doi.org/10.1016/j.appet.2007.10.007

___________________________________________________________________________________________________________________
TASK DESCRIPTION
___________________________________________________________________________________________________________________	
A participant is presented with a series of digits (1-9) on a computer screen. The presentation time 
is 100 digits/min (or 1digit/600ms). The participant's task is to press a response key (here: Spacebar) 
as soon as they detect a series of three consecutive odd or three consecutive even digits.
By default, the task runs for 5 minutes and generates a unique sequence of digits with roughly 8% targets
and target distances from 5-20.

___________________________________________________________________________________________________________________	
DURATION 
___________________________________________________________________________________________________________________	

The default task duration is 5 minutes.
___________________________________________________________________________________________________________________	
DATA OUTPUT DICTIONARY
___________________________________________________________________________________________________________________	
The fields in the data files are:

(1) Raw data file: 'cdb_rvip.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.	
//Parameter:									
taskDurationMin:				the set task duration in minutes 									
									
																													
focusDigit3:					the three digits that need to be checked to see if they are all odd or all even														
focusDigit2:
focusDigit1 :
digit:							the digit presented in the current trial
btwTargetsCounter:				counts the number of digits between target trials

target:							0 = no target presented; 
								1 = target presented (the third digit in a row of either all odd or all even digits)
								Note: while the current digit may not be a target, the trial might still accept
								target responses if the previous target is still active
								
targetStartTime:				the script elapsed time (in ms) the last target was presented 
startTrialTime:					the script elapsed time the current trial started (in ms)

(parameter) targetResponseWindow:	the time window during which a target is active (here: up until 1500ms after onset of a target, consistent with Wesnes & Wartburton (1984))
targetResponseEndTime:			starttrial of a target-trial + interval (in ms)

targetActive:					0 = target not active; 
								1 = target still active (even though the currently presented digit itself might not be a target)
								
response:						the participant's response (e.g. scancode of response key)
								57 = spacebar
								0 = no response
																				
correct:						the correctness of the response (1 = correct; 0 = incorrect)

responseTime:					the script elapsed time when a spacebar response is made (in ms)

rtHit:							the response latency (in ms) for the current Hit; 
								=> calculated as difference between responseTime-targetstarttime
								=> thus measures the time it took to hit spacebar after a target was presented 
								(latency measured from onset of last target) 

latency: 						the trial latency (in ms) (for the current trial)
								Note: measures the response time of hitting the spacebar measured
								from onset of current digit (if no response, this variable stores the trial duration)
										
										
hit:							1 = spacebar press was registered during the current trial while a target was still active
								0 = no spacebar press was registered during the current trial while a target was still active
								"" (empty): no active target during the current trial
									
fa:								1 = spacebar press was registered during the current trial while no target was active
								0 = no spacebar press was registered during the current trial while no target was active
								"" (empty): the target was still active during the current trial
										
sumTargets:						counts how many targets have been presented
								
sumHit:							counts the number of Hits
sumFA:							counts the number of False Alarms

//test digit sequence information:
flag:							0 = a unique sequence could be generated	

								1 = a unique sequence could NOT be generated within 500 attempts
								and an emergency sequence from an existing pool was used instead
								(for totalTaskDurations_inmin = 3, 6 or 9 with targetProp = 0.08 
								and presentationtime = 600ms)
								
								2 = a unique sequence could NOT be generated within 500 attempts
								and the original RVIP sequence (see list.digitsequence in this script) 
								was shortened for the requested totalTaskDurations_inmin.
								
								NA = no unique sequence was requested 

sequenceLength:				the length of the test digit sequence
propTargets:					proportion of targets in target sequence as calculated by (number of targets/number of digits)
meanTargetDistance:				the mean digit distances btw. target sequences
targetPositions:				the target positions in the sequence (target position = position of last digit of the trio)
sequence:						the digit sequence used for test

Note: if the original RVIP sequence was simply shortened, you will find additional "NA" values in your datafile


(2) Summary data file: 'cdb_rvip_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)
								
//Parameter:									
taskDurationMin:				the set task duration in minutes 									
									
propCorrect:					proportion correct target detection (test)
sumTargets:						counts how many targets have been presented (test)
sumHit:							counts the number of Hits (test)
sumFA:							counts the number of False Alarms (test)
meanRTHit:						determines the mean hit RT (in ms) - measured from onset of last target digit (test only)
stdHit:							determines standard deviation of hit RTs (test only)
medianRTHit:					determines the median hit RT (in ms) - measured from onset of last target digit (test only)

//test digit sequence information:
flag:							0 = a unique sequence could be generated	

								1 = a unique sequence could NOT be generated within 500 attempts
								and an emergency sequence from an existing pool was used instead
								(for totalTaskDurations_inmin = 3, 6 or 9 with targetProp = 0.08 
								and presentationtime = 600ms)
								
								2 = a unique sequence could NOT be generated within 500 attempts
								and the original RVIP sequence (see list.digitsequence in this script) 
								was shortened for the requested totalTaskDurations_inmin.
								
								NA = no unique sequence was requested  

sequenceLength:					the length of the test digit sequence
propTargets:					proportion of targets in target sequence as calculated by (number of targets/number of digits)
meanTargetDistance:				the mean digit distances btw. target sequences
targetPositions:				the target positions in the sequence (target position = position of last digit of the trio)
sequence:						the digit sequence used for test

Note: if the original RVIP sequence was simply shortened, you will find additional "NA" values in your datafile

__________________________________________________________________________________________________________________	
EXPERIMENTAL SET-UP 
___________________________________________________________________________________________________________________	

(1) Test: 
This customized script calculates the number of digits for the test sequence based on 
parameters.totalTaskDurationMin.

If parameters.UseExistingSequence = false:
The script attempts to generate a unique digit sequence for the test.
The targetProportion is set around 0.8 and the distances btw. targets is btw. 5-20
(more information about the algorithm see below)

If parameters.UseExistingSequence = true:
The script cut the original RVIP test sequence according to the calculated number of digits

TrialSequence:
A new digit is presented every 600ms.
The response to the last digit of a target sequence is scored as a Hit if the participant reacts 
within 1500ms (target response window described in Wesnes & Wartburton (1984), can be changed by  
experimenter in this script)  of  onset of the last digit of a target sequence.  
Any response that occurs later is scored as a False Alarm. 

////ALGORITHM DESCRIPTION of Sequence Generator (see script cdb_sequencealgorithm.iqjs):
- the script attempts to generate a unique digitsequence (digits 1-9) for expressions.numberOfDigits
(depends on parameters.taskDurationMin) within 500 attempts
- the digit sequence should contain roughly 8% (see parameters.propTargets) targets 
(targets = three odd or three even consecutive digits)
accepted target proportions: targetProportion-0.005 < targetProportion < targetProportion + 0.005
=> btw. 0.075 - 0.085
- the distance btw. target sequences are randomly selected (with replacement) from 5-20 

IN CASE no unique sequence can be generated within 500 attempts:

1. for parameters.taskDurationMin = 5
If no unique sequence can be generated within 500 attempts, the script randomly samples from
a pregenerated list of emergency digitsequences and leaves a note in the data file (values.flag = 1).
These pre-generated sequence use targetProp ~ 0.08 
(Note: if that proportion is changed the emergency lists are suspended)

2. for any other parameters.taskDurationMin
The script will use the original fixed sequence of the RVIP (see list.digitsequence) and cut it to the necessary
digit sequence. Values.flag will be 2 in the datafile and no further information about the sequence will be
stored.

This script procedure does not run a practice run.
___________________________________________________________________________________________________________________	
INSTRUCTIONS 
___________________________________________________________________________________________________________________	
to edit instructions, go to 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:


___________________________________________________________________________________________________________________	

										*RAPID VISUAL INFORMATION PROCESSING*
										SEQUENCE GENERATOR (HELPER SCRIPT) for
										cdb_rvip.iqjs
___________________________________________________________________________________________________________________	

Script Author: Katja Borchert, Ph.D. (katjab@millisecond.com) for Millisecond Software, LLC
last updated:  06-03-2024 by K. Borchert (katjab@millisecond.com) for Millisecond Software, LLC

Script Copyright © 06-03-2024 Millisecond Software
___________________________________________________________________________________________________________________
BACKGROUND INFO 	
___________________________________________________________________________________________________________________	

This helper script implements a sequence generator for the cdb_rvip.iqjs

////ALGORITHM DESCRIPTION:
- the script attempts to generate a unique digitsequence (digits 1-9) for expressions.numberOfDigits (main RVIP script)
within 500 attempts
- the digit sequence should contain roughly 8% (see parameters.propTargets) targets 
(targets = three odd or three even consecutive digits)
accepted target proportions: targetProportion-0.005 < targetProportion < targetProportion + 0.005
=> btw. 0.075 - 0.085
- the distance btw. target sequences are randomly selected (with replacement) from 5-20 

IN CASE no unique sequence can be generated within 500 attempts:

1. for parameters.taskDurationMin = 5
If no unique sequence can be generated within 500 attempts, the script randomly samples from
a pregenerated list of emergency digitsequences and leaves a note in the data file (values.flag = 1).
These pre-generated sequence use targetProp = 0.08 (Note: if that proportion is changed the emergency lists are suspended)

2. For parameters.taskDurationMin that are not set to 5
The script will use the original fixed sequence of the RVIP and cut it to the necessary
digit sequence. values.flag will be 2 in the datafile and no further information about the sequence will be
stored.




___________________________________________________________________________________________________________________	

								*VISUAL ANALOG RATING SCALE*
								as part of the The Cognitive Demand Battery (CDB)
								(mouse/touchscreen input)	
								German instructions
___________________________________________________________________________________________________________________	


Script Author: Katja Borchert, Ph.D. (katjab@millisecond.com) for Millisecond Software, LLC
Date: 06-04-2024
last updated:  06-04-2024 by K. Borchert (katjab@millisecond.com) for Millisecond Software, LLC

Script Copyright © 06-04-2024 Millisecond Software

German translations provided by K. Borchert for Millisecond Software

___________________________________________________________________________________________________________________
BACKGROUND INFO 	
___________________________________________________________________________________________________________________
This script implements Millisecond Software's version of a custom Visual Analog Rating Scale
to assess mental fatigue. The procedure is run as part of the Cognitive Demand Battery (CDB) 
(Kennedy et al, 2008).

Reference:											
///Cognitive Demand Battery (CDB):
Kennedy, D. O., Haskell, C. F., Robertson, B., Reay, J., Brewster-Maund, C., Luedemann, J., 
Maggini, S., Ruf, M., Zangara, A., & Scholey, A. B. (2008). Improved cognitive performance and 
mental fatigue following a multi-vitamin and mineral supplement with added guaraná ( Paullinia cupana). 
Appetite, 50(2), 506–513. https://doi.org/10.1016/j.appet.2007.10.007

___________________________________________________________________________________________________________________
TASK DESCRIPTION	
___________________________________________________________________________________________________________________
Participants are asked to rate how mentally fatigued they feel on a 100mm long line with the anchors
"not at all" (left) and "very much so" (right). Ratings were scored as 0-100 based on their relative position
on the line.

___________________________________________________________________________________________________________________	
DURATION 
___________________________________________________________________________________________________________________	
the default set-up of the script takes appr. 1 minute to complete

___________________________________________________________________________________________________________________	
DATA OUTPUT DICTIONARY
___________________________________________________________________________________________________________________
The fields in the data files are:

(1) Raw data file: 'cdb_vas_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:					with the current subject id
group: 						with the current group id
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. 

rating:						the current rating number (continuous scale 0-100) 
ratingRT:					current sum of all rating latencies 
															
response:					the response stimulus
latency:					response latency (in ms); measured from: trial onset

//debugging variables:
shape.marker.xPx;			the canvas horizontal pixel position of the marker
sliderStartXPX:				the canvas horizontal pixel position of the start point of the slider line 
sliderEndXPX:				the canvas horizontal pixel position of the end point of the slider line 

(2) Summary data file: 'cdb_vas_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)

rating:						the final rating (continuous on scale from 0-100)
ratingRT:					the final sum of all rating latencies 							
___________________________________________________________________________________________________________________	
EXPERIMENTAL SET-UP 
___________________________________________________________________________________________________________________	

Participants are asked to rate how mentally fatigued they feel on a 100mm long line with the anchors
"not at all" (left) and "very much so" (right). 
After placing their initial marker on the line, they can correct its position by either
a) clicking on the line or b) dragging the marker along the line before submitting their rating
via a 'submit' button. 
___________________________________________________________________________________________________________________	
STIMULI
___________________________________________________________________________________________________________________

provided by Millisecond Software
___________________________________________________________________________________________________________________	
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: