Return to the Wisconsin Card Sort Test page
___________________________________________________________________________________________________________________	

									WISCONSIN CARDSORT TEST (WCST)
___________________________________________________________________________________________________________________	

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

Script Copyright © 07-24-2020 Millisecond Software

___________________________________________________________________________________________________________________
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)* 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.

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****
Response coding may differ from published definitions. Please check the definition of the coded variables 
used in this script under the data glossary.

___________________________________________________________________________________________________________________
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 FILE INFORMATION 
___________________________________________________________________________________________________________________
The default data stored 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
script.sessionid:					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.
																									
count_ColorBlocks:					the number of color blocks started
count_FormBlocks:					the number of number blocks started
count_NumberBlocks:					the number of form blocks started				
											
colortrialcount/numbertrialcount/formtrialcount:	sum up the trials run by category

totaltrials:						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)

PerseverativeResponse:				in this script:
									1 = response is still in compliance with the old rule after a rule switch (and 
									no response has been made yet that violates the old rule)								
									0 = any other response
									Note: this definition of a PerseverativeResponse likely differs from others
									(e.g. Heaton et al, 1993). To score responses according to rules such as published by 
									Heaton et al (1993) the raw responses need to be scored manually. 
									
PerseverativeError:					in this script:
									1 = response is still in compliance with the old rule after a rule switch (and 
									no response has been made yet that violates the old rule) AND response is scored as incorrect							
									0 = any other response
									Note: this definition of a PerseverativeError likely differs from others
									(e.g. Heaton et al, 1993). To score responses according to rules such as published by 
									Heaton et al (1993) the raw responses need to be scored manually			
								
totalcorrect:						sums up all the correct responses across the task
totalerror:							sums up all the incorrect responses across the task



(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. 

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

parameters.cstotalblocks:  				Maximum Number each category is tested (default = 2)
parameters.correctstreakthreshold:  	Number of consecutive correct responses before a rule change (default = 10)

parameters.setmaintainthreshold: 		Number of consecutive correct responses after which an incorrect
										response is scored as a "Failure to maintain Set" (default = 5)
								
parameters.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))
								
count_ColorBlocks:						the number of color blocks started
count_FormBlocks:						the number of number blocks started
count_NumberBlocks:						the number of form blocks started
															
colortrialcount/formtrialcount/numbertrialcount:	sum up the trials run by category

totaltrials:							counts the total trials run
totalcorrect:							sums up all the correct responses across the task
totalerror:								sums up all the incorrect responses across the task


Note: See definitions for 'PerseverativeResponse' and 'PerserverativeError' under raw data values.
sum_perseverativeerror:					sums up all error trials with values.perseverativeresponse = 1
expressions.percent_perservativeerror:	percentage of Perserverative Errors (relative to all errors made)
Sum_PerseverativeResponses:				Keeps a total of the number of perseverative responses made throughout the test

Percent_PerserverativeResponses:		percentage of PerserverativeResponses of all trials
										Note: in this WCST script, a perseverative response is not automatically categorized 
										as an error since some cards can be ambiguous.
										

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

Sum_FailureMaintainSet					keeps a total of the number of times a participants selects an incorrect card

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)

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

Diff_C1F1 etc.:							Difference scores of percent errors in adjacent categories
											(e.g. Diff_C1F1 = 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 Errors
- PerseverativeResponse (as defined under VALUES) / Number of PerseverativeResponses across Experiment / % of PerseverativeResponses of all 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.

___________________________________________________________________________________________________________________	
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%)