User Manual: Inquisit Wisconsin Card Sort Test


___________________________________________________________________________________________________________________	

									WISCONSIN CARDSORT TEST (WCST) 
									(Chinese Instructions)
___________________________________________________________________________________________________________________	

Script Author: Katja Borchert, Ph.D. (katjab@millisecond.com) for Millisecond Software, LLC
Date: 07-24-2012
last updated:  08-20-2024 by K. Borchert (katjab@millisecond.com) for Millisecond Software, LLC

Script Copyright © 08-20-2024 Millisecond Software

Millisecond Software thanks Stephanie Miles and Caitlin Howlett for ample support in continuously 
improving the Inquisit WCST script!

___________________________________________________________________________________________________________________
BACKGROUND INFO 	
___________________________________________________________________________________________________________________	
This script implements a computerized version of the Wisconsin Cardsort Test (WCST);
a test of cognitive flexibility upon (unannounced) rule changes.
The WCST implemented in this script is based in part on Grant & Berg (1948)* as well as Heaton et al (1993)
and is played with 2 decks of cards (64 cards in each deck).

Reference for WCST:
Grant, D.A. & Berg. E.A. (1948). A behavioral analysis of degree of reinforcement and ease of shifting to
new responses in a Weigl-type card sorting problem. Journal of Experimental Psychology, 38, 404-411.

Heaton, R., Chelune, G., Talley, J., Kay, G., & Curtiss, G. Wisconsin Card Sorting Test Manual—Revised
and Expanded 1993. Lutz, FL: Psychological Assessment Resources Inc

Additional WCST information to read:
Miles, S., Howlett, C.A., Berryman, C. et al. Considerations for using the Wisconsin Card Sorting Test 
to assess cognitive flexibility. Behav Res (2021). https://doi.org/10.3758/s13428-021-01551-3

NOTE: 
1) To play the short version (WCST-64) with only one deck of cards, 
change parameters.csTotalTrials from 128 to 64 under section EDITABLE PARAMETERS.

****DISCLAIMER****
This script* runs Millisecond's best effort attempt to code perserverative responses according to the guidelines
outlined by Heaton et al (1993). Coding may, however, still differ from published definitions or contain errors. 
Please check the definitions of the coded variables used in this script under the data glossary.
If in doubt, manually score the raw responses.

*Note: previous Inquisit WCST scripts may have used a different definition of Perserverative Responses

___________________________________________________________________________________________________________________
TASK DESCRIPTION	
___________________________________________________________________________________________________________________	

Participants are asked to sort cards into four different "categories". No instructions are
given in regard to the categorization rules.
The four different categories are
- one red triangle
- two green stars
- three yellow crosses
- four blue circles.
The cards to sort into these piles have similar designs and 
vary in color (4), shape (4), and number (4).

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

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

(1) Raw data file: 'wcst_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.
										
phase:								'testing'
									'scoring' - 'duplicates' the selected raw data and adds scoring of perserverative response
																																			
countColorBlocks:					the number of color blocks started
countFormBlocks:					the number of number blocks started
countNumberBlocks:					the number of form blocks started				
											
colortrialcount/numbertrialcount/formtrialcount:	sum up the trials run by category

trialCount:							counts the total trials run
category :							1 = color; 2 = form; 3 = number

stimulusItem.1:						the presented target card									
stimulusItem.2-
stimulusItem.5:						the selection of cards to choose from (stay the same throughout the task)

response:							the participant's response (card selection)
latency: 							the response latency in ms; measured from onset of target card

responseCategory:					=> records features that the selected card (response) and the test card have in common
									CFN (color, form, number); CF (color; form); CN (color, number); FN (form, number)
									C (color); F (form); N (number); O (other)
									
ambiguous:							0 = responseCategory "C", "F", "N" are unambiguous
									1 = any other response									
									
correct:							the correctness of the response (1 = correct; 0 = otherwise)
correctStreak:						counts consecutive correct responses (if an error is made, it's reset back to 0)
											
totalCorrect:						sums up all the correct responses across the task
totalError:							sums up all the incorrect responses across the task


Additional data columns used to code perseverative responses (the algorithm to code perseverative responses
runs AFTER all raw data have been collected as some responses will be coded as perseverative responses
only in retrospect). All the following columns are filled under block.rawDataScoring/trial.scoring

//duplicates raw data for scoring purposes
scoringDeckCount:					tracks the number of decks run
scoringTrialCount:					tracks the number of total trials run
scoringTrialCountPerCategory:		tracks the number of trials run per category
scoringCategoryCount:				tracks the number of categories run
scoringCategory:					tracks the category run: 1 = C; 2 = F; 3 = N
scoringCard:						tracks the specific card presented during the trial
scoringResponse:					tracks the selected response card
scoringRespCategories:				tracks the response category; e.g. CN => the response falls into the color/number categories
scoringAcc:						tracks the accuracy of the response: 1 = correct (aka respCategories contained the current category); 0 = error
scoringCorrectStreak:				tracks the number of consecutive correct responses
scoringAmbiguousResponse:			tracks the ambiguity of the response: 1 = ambiguous response (falls into one than more than one response category); 0 = unambiguous response

scoringPerseverativeResponse:		tracks perseverative responses: 
									1 = perseverative response (pResponse); 
									0 = not scored as a pResponse* (see below for how pResponses are scored in this script)
									
scoringPResponsePrinciple:			tracks the pResponse-principle that were (likely) currently in effect for scoring pResponses

scoringPerseverativeError:			1 = response was incorrect AND coded as perserverative
									0 = otherwise

(2) Summary data file: 'WCST_summary*.iqdat' (a separate file for each participant)

!!!!Important Note: the definitions of the summary variables in this script might differ from the originals. 

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)	
								
Important Note: the definitions of the summary variables in this script might differ from the originals.								
								
csTotalTrials:						Maximum Number of trials (default = 128 => 2 decks x 64 cards)	

csTotalBlocks:  					Maximum Number each category is tested (default = 2)
correctStreakThreshold: 			Number of consecutive correct responses before a rule change (default = 10)

setmaintainThreshold: 				Number of consecutive correct responses after which an incorrect
									response is scored as a "Failure to maintain Set" (default = 5)
								
showDeckInfo:  						if set to "true" information about the deck (e.g. 1 of 2) and card number
									(e.g. 7 of 64) are displayed on the screen for the participant to see (default: false (0))
								
countColorBlocks:					the number of color blocks started
countFormBlocks:					the number of form blocks started
countNumberBlocks:					the number of number blocks started
															
colortrialcount/formtrialcount/numbertrialcount:	sum up the trials run by category

trialCount:							counts the total trials run
totalCorrect:						number of correct responses across the task

numberErrors:						number of total errors (all incorrect responses) made
percentErrors:						percentage of incorrect responses (relative to all responses) 

Note: See Definition of 'PerserverativeResponse' below under explanation of implemented algorithm
numberPResponses:			number of perseverative responses made
percentPResponses:			percentage of Perserverative Responses (relative to all responses)

numberPErrors:				number of perseverative errors (Note: responses have to be incorrect AND scored as perseverative)
percentPErrors:			percentage of Perserverative Errors (relative to all responses)	


numberOtherErrors:			number of 'Other' error responses
percentOtherErrors:		percentage of Other error responses (relative to all responses)

																				
completedCategories:			number of categories (color, form, number) successfully completed (min = 0, max = 6)

sumFailureMaintainSet:		keeps a total of the number of times a participants selects an incorrect card
							after a correctstreak that was >= setmaintainThreshold

trialsCompleteFirstCategory:	keeps track of how many trials a participant needed to complete the first category
after having maintained a correct streak of 5 or higher (default)

								
percenterrorC1/.../percenterror N2:	percent errors in the first color category ....percent errors in the second number category (etc.)

DiffC1F1 etc.:							Difference scores of percent errors in adjacent categories
											(e.g. DiffC1F1 = percenterrors in first color category - percenterrors in first form category)
								
learningToLearn:						the mean of the obtained difference scores

___________________________________________________________________________________________________________________	
EXPERIMENTAL SET-UP 
___________________________________________________________________________________________________________________	
(1)  Cards:
- Participants receive the equivalent of 2 decks of cards. Each deck contains 64 different cards.
- Researchers can set whether to display the deck/card info for the participants 
on the screen under section EDITABLE PARAMETERS
- the cards of each deck are randomized without replacement (see list.selectcard for more detail)

(2) Order of Categorization Rules: Color -> Form -> Number
- Maximal 2 of each category
- Rules change after 10 consecutive correct responses for a category (default, can be changed under 
VALUES)

(3) End of Task:
(a) reached the maximum number of cards:
- Maximum Number of Trials/Cards: 2 (decks) x 64 (cards) => 128 cards 
(b) successfully completed 2 sequences of the color->form->number sequence
- Minimum number of trials/Cards = 10 (correct trials per block) * 6 (max number of blocks)=> 60 cards

(4) Instructions
- Instructions can easily be changed under EDITABLE INSTRUCTIONS
- Text Stimuli can be easily changed under EDITABLE STIMULI

(5) Dependent Variables/Scores:
- latency of response
- accuracy of response
- total number of correct responses/total number of errors
- Total Number/Percentage of perseverative responses
- total number of trials
- number of trials needed to complete first category
- categories completed (Max = 6)
- Number of "Failures to Maintain Set" across Experiment
- "Learning to Learn" measures: error difference scores (of percentages) from adjacent categories

IMPORTANT NOTE: please be aware that the definitions of the summary variables in this script might differ from the originals
as well as from other published ones.

___________________________________________________________________________________________________________________	
ALGORITHM TO SCORE PERSERVERATIVE RESPONSES (see Heaton et al, 1993)
___________________________________________________________________________________________________________________	

Perserverative Responses: “persistence to respond according to a stimulus characteristic 
that is currently incorrect (although perseverative responses can also be correct because of the potential 
for ambiguous responses and the sandwich rule)”

First (Color) Block:
- the first unambiguous error sets the pResponse-Principle BUT is not scored as a pResponse in itself
(Note: only C/F/N responses considered for setting the pResponse-Principle)
- the next time an unambiguous error of the pResponse-Principle is made, it's scored as a pResponse

Subsequent Blocks:
- the previous correct category becomes automatically the pResponse-Principle and all subsequent
unambiguous errors of the pResponse-Principle are scored as a pResponse.

Sandwich pResponses: 
all ambiguous responses (can also be scored as correct!) that contain the pResponse-Principle
made inbetween two unambiguous pResponses (=sandwiched btw. two pResponses) are also scored as pResponses.

Example: 
Begin of Form Block: Form category is correct, Color category is pResponse-Principle

CF => correct response (contains F)
C (incorrect response) => unambiguous C error: pResponse
  CF (correct response) => sandwiched btween two pResponses AND contains C => all responses btw. 2 pResponses contain C => all are scored as pResponses as well (even if the response is scored as correct)
  CN (incorrect response) => sandwiched btween two pResponses AND contains C => all responses btw. 2 pResponses contain C => all are scored as pResponses as well 
  CFN (correct response )=> sandwich btween two pResponses AND contains C => all responses btw. 2 pResponses contain C => all are scored as pResponses as well 
C => second unambiguous C error: pResponse (the script retrospectively scores the sandwich responses as pResponses)

!IMPORTANT: pResponse-Principle changes
According to Heaton et al (1993) the pResponse-Principle of a block can change.
This can happen if a participant makes three unambiguous errors of the NON-pResponse-Principle (in this script: 
these responses have to be made UNinterrupted by unambiguous errors of the pResponse Principle but can be interrupted by correct responses
or responses of the O-category) and ALL AMBIGUOUS responses 
inbetween these three unambiguous error responses contain the NON-pResponse-Principle). 
In these cases the pResponse-principle changes and all responses that contain the new pResponse-principle from (and including) the 
SECOND to the THIRD unambiguous error are scored as a pResponse.

Example: 1. Block (color is the correct category)

1) N (first unambiguous incorrect response)
=> sets the pResponse-principle (N) (but not a pResponse!)

2) NC 
=> 'correct' (not sandwiched inbetween pResponses)

3) N (incorrect)
=> first actual pResponse

4) F (incorrect)
=> first unambiguous error of the F-category

5) CN (correct)
=> ambiguous C/N response (scorred as 'correct')

6) F (incorrect)
=> second unambiguous error of the F-category (after trial7 will turn into the first unambiguous error of the F-category)

7) F (incorrect)
=> third unambiguous error of the F-category 
=> HOWEVER, not all responses btw, the third (trial7) and first F-error (trial4) contain F 
=> therefore trial7 unambiguous F-error will be re-classified as the second F-error
=> after trial8 this error will be retrospectively scored as the first pResponse of the F category

8) F (incorrect) => scored as the NEW third unambiguous F-error 
=> all responses up to trial 6 contain F 
=> F is the new pResponse-principle 
=> all trials btw. trial 8 and trial7 (including trial 7) are retrospectively scored as pResponses

9) N (incorrect)
=> 'simple' error (not a pResponse as the pResponse-Principle has changed)
___________________________________________________________________________________________________________________	
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:

csTotalTrials: 					Maximum Number of trials (default = 128 => 2 decks x 64 cards)
csTotalBlocks:  				Maximum Number each category is tested (default = 2)
correctStreakThreshold:  		Number of consecutive correct responses before a rule change (default = 10)
setmaintainThreshold: 			Number of consecutive correct responses after which an incorrect response is scored as a "Failure to maintain Set" (default = 5)

showDeckInfo:  					if set to " true" information about the deck (e.g. 1 of 2) and card number (e.g. 7 of 64) 
								are displayed on the screen for the participant to see (default: false)

/picSize:						size of cards determined by canvas height percentage (default:30%)