Return to the Mental Arithmetic Task page

Script Author: Katja Borchert, Ph.D. ( for Millisecond Software, LLC
Date: 09-18-2014
last updated: 04-19-2017 by K.Borchert ( for Millisecond Software LLC

Copyright © 04-19-2017 Millisecond Software


This script implements a computerized Math Task as described in:

Girdler, S. S., Turner, J. R., Sherwood, A., & Light, K. C. (1990). Gender differences in blood pressure control 
during a variety of behavioral stressors. Psychosomatic Medicine, 52, 571- 591.

Turner, J. R., Hewitt, J. K., Morgan, R. K., Carroll, D., Sims, J., & Kelly, K. A. (1986). Graded mental arithmetic 
as an active psychological challenge. International Journal of Psychophysiology, 3, 307-309.

The math task adjusts for individual difference in math performance.

Participants work on 40 (default) subtraction problems. Each problem consists of the presentation of the problem for 2s (default);
the presentation of an "=" sign (default) for 1s (default), and the presentation of an answer to the problem for 1s (default).
Participants have to press one key (SPACEBAR) if the presented answer is the correct answer and simply wait if
the presented answer is an incorrect answer.
The subtraction problems are divided into 5 levels of difficulty (Turner et al, 1986). If participants make the correct choice, 
they move up a level of difficulty. If participants make an incorrect choice (or don't answer fast enough),
they move down a level of difficulty.

The default data stored in the data files are:

(1) Raw data file: 'MathTask_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 
blockcode, blocknum:			the name and number of the current block
trialcode, trialnum: 			the name and number of the currently recorded trial
									(Note: not all trials that are run might record data) 
/countmathproblems:				tracks the number of math problems run
/difficulty:					stores the level of difficulty of the current math problem
/correctness:					1 = presented answer is correct; 2 = presented answer is incorrect
/mathproblem:					stores the math problem in a string without white spaces (for evaluation purposes)
/correctsolution:					stores the correct answer of the problem
/presentedsolution:							stores the presented answer (either correct or foil)
response:						the participant's response
correct:						the correctness of the response
latency: 						the response latency (in ms)
/count_diff5:					 counts the number of problems worked on for each level of difficulty

(2) Summary data file: 'MathTask_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)
/countmathproblems:				tracks the number of math problems run
/prop_correct:					proportion correct responses
/prop_diff5:					proportion of problems worked on for each level of difficulty

- subtraction problems are divided into 5 levels of difficulty (Turner et al, 1986; only subtraction problems):
	Level1: 1digit - 1 digit problems (e.g. 7 - 5)
	Level2: 2digits - 1 digit problems (e.g. 28 - 4)
	Level3: 2digits - 2digits problems (e.g. 56 - 23)
	Level4: 3digits - 2digits problem (e.g. 487 - 67)
	Level5:	3digits - 3digits problem (e.g. 359 - 128)

- problems are randomly generated for each levels 
- participants work on 40 subtraction problems starting with a problem of midlevel difficulty (3).
- depending on performance they move up (correct decision) and down levels (incorrect decision)
- half the presented solutions are correct; the other half are incorrect foils

Trial Sequence:
a) Presentation of Problem for 2s (default) -> 
b) presentation of '=' sign for 1s (default) -> 
c) presentation of a solution (correct or incorrect) for 1s (Participants have entire time to make the choice whether
the answer is the correct solution to the problem or not)
d) immediate feedback for 500ms (to change feedback duration go to section TRIALS and follow further instructions)

Foil Creation: (Neither Girdler et al nor Turner et al provide an algorithm of how their foils were created)
Because a random generation of foils could potentially ending in very simple problems (mostly one would only have
to be able to pay attention to the last digits), a somewhat more complicated algorithm was used in this script:
- if subtrahend has only 1 digit OR correctsolution has only 1 digit => presented foil = correctsolution +/- 1
- if subtrahend has more than 1 digit AND correctsolution has more than 1 digit => presented foil = correctsolution +/- 10

math problems are randomly generated

Instructions are provided by Millisecond Software LLC. They are not original to Girdler et al (1990) nor
to Turner et al (1986). Go to section Editable Instructions for more details.

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:

/correctresponsekey1:						scancode of the correct  response key
												Note: scancodes under Tools -> Keyboard Scancodes (default: 57)		
/correctresponsekey_label:					label of the corrcet response key (default: SPACEBAR)

/fontsize_stims:							size of the math problem, equal sign and presented answer in % of canvas height

/mathproblemduration:						presentation duration of the mathproblem in ms (default: 2000ms)
/equalsignduration:							presentation duration of the equal sign in ms (default: 1000ms)
/mathanswerduration:						presentation duration of the answer to the mathproblem in ms (default: 1000ms)
												Note: participants have the entire duration to respond
/iti:										intertrial duration: pause inbetween problems

/runoperation:								1 = runs only addition problems
											2 = runs only subtraction problems (default)
											3 = runs mixed problems per level

/maxnr_mathproblems:						the number of math problems to run (default: 40)

Copyright © Millisecond Software. All rights reserved.
Contact | Terms of Service | Privacy Statement | Security Statement | GDPR
Website Security Test