Introduction

Card sorting tests have a long tradition in psychology, going back more than a 100 years to the work of Ach. In 1948, Grant and Berg published their now very famous Wisconsin Card Sorting Test. It is a test of cognitive reasoning. Later, in the 1960s, Milner started to use this cognitive test to assess patient’s level of brain damage to the prefrontal cortex.

The original Wisconsing Card Sorting Test was developed for use with patients with brain damage. It is probably not so useful to compare executive control function in healthy people. Instead, you may better go for one of the task switching or N-back tasks.

In short, in the WCST, people have to classify cards according to different criteria. There are four different ways to classify each card, and the only feedback is whether the classification is correct or not. One can classify cards according to the color of its symbols, the shape of the symbols, or the number of the shapes on each card. The classification rule changes every 10 cards, and this implies that once the participant has figured out the rule, the participant will start making one or more mistakes when the rule changes. The task measures how well people can adapt to the changing rules.

About this implementation

This task is not the actual Wisconsin Card Sorting Test, as copyrighted in the US, but instead it is a computer-based task that is inspired by the original work by Berg, and different in a number of important aspects. If you want to have the original exact Wisconsin Card Sorting Test, please find the publisher’s information.

In the example, there are four cards on screen. Your task is to figure out the classification rule to sort the card (a grey rectangle) at the bottom left. You just click the card that matches the rule, and you will get feedback about your choice. At the end you see the count and percentage of your errors (the PsyToolkit feedback function is being used).

There are different types of error reports:

  1. Total number errors

  2. Perseveration errors (when you keep applying the old rule)

  3. Non-perseveration errors

Notes:

  • The sum of perseveration and non-perseveration erros is the total number of error.

  • Everybody will by definition make some mistakes, because you need some feedback to figure out the rule. The point of the WCST is that certain patients make unually many persevertion errors

  • In the first block, there are by definition no perseveration errors (because there is no "previous task")

Run the demo

Use the mouse to click the matching "card" (detailed instruction is on screen).

Data output file

In PsyToolkit, the data output file is simply a textfile. The save line of the PsyToolkit experiment script determines what is being saved in the data output file. Typically, for each experimental trial, you would have exactly one line in your text file, and each number/word on that line gives you the information you need for your data analysis, such as the condition, response speed, and whether an error was made.

Meaning of the columns in the output datafile. You need this information for your data analysis.

Colum Meaning Values

1

the card shown

a number between 1 and 64 (you do not really need this for further data analysis, because the info is also below in the detailed card description)

2

the card that should be clicked of the top four on screen

a number between 1 and 4

3

the card that would be clicked if the participant is persevering

a number between 1 and 4

4

the trial in a sequence

number between 1 and 10. 1 is the first, thus the rule switch

5

name of the task

shape, number, color

6

detailed card description: shape

circle, start, cross,triangle

7

detailed card description: number of symbols on the card

1,2,3,4

8

detailed card description: color

yellow,blue,green,red

9

Reaction time in milliseconds

between 1 and 10,000, that is max response is 10 seconds

10

Status

1=correct, 2=wrong card, 3=too slow

11

the card that was actually clicked

a number between 1 and 4, or 0 if none clicked

12

If 1, this trial was an error (otherwise 0)

0 or 1

13

If 1, this trial was a perseveration error (otherwise 0)

0 or 1

14

If 1, this trial was not a perseveration error (otherwise 0)

0 or 1

Data Analysis

Note that there are two ways to get the data.

  1. You can just write down the errors from the feedback screen. This does of course only work if you are sitting with your participant

  2. All the data is saved. If you embed the WCST in an online survey, make sure you set the "analyze" section of your experiment, it is fairly easy.

  3. For "Which column has the reaction time" you set 9 (see table above to explain why)

  4. For "Which column has the status (correct=1)" you set 13 if you want to analyze perseveration errors

  5. Save this and then go to your survey. Download the data. You will now have a spreadsheet with the perseveration errors.

FAQ

How do I get the perservation errors?

  1. Go to your experiment, then goto the Analyze section.

  2. In Set the meaning of the columns in the data file

    • Set the first little box (reaction time/dependent variable) to 9

    • Set which column has status (correct=1)? to 13

    • Set the which value is correct (if not 1)? to 0

    • Leave all the other value boxes here empty.

  3. Now run analysis on a test output file. The "Error rate" is now the percentage perseverative errors.

  4. Now in your survey (if you have one), goto Prepare and download participant data and click the Prepare datafiles for download button

  5. Download the data, and look at the file ending in pe.xlxs.

For example, if your experiment is called WCST, there will be a file called WCST.pe.xlsx (on windows, this might show up as just WCST.pe with the Excel symbol).

In your Excel file, you will now see for each participant the percentage of perservaration errors made. The rows of this file are in the same order as in data.xlsx, so it easy to combine the data from the two Excel files.

PsyToolkit code

Click to expand the PsyToolkit script code (part of zip file below)
options
  mouse on           # mouse is being used, so do not hide it
  bitmapdir stimuli  # location of the bitmaps
  sounddir stimuli   # location of sound files
  escape             # you can escape by holding escape until end of trial

fonts
  arial 18

bitmaps
  circle1blue        # this refers to bitmaps/circle1blue.png
  circle1green       # etc.
  circle1red         # each card is 100x100px
  circle1yellow      # you can change this, of course, making
  circle2blue        # changes to the SVG file
  circle2green
  circle2red
  circle2yellow
  circle3blue
  circle3green
  circle3red
  circle3yellow
  circle4blue
  circle4green
  circle4red
  circle4yellow
  cross1blue
  cross1green
  cross1red
  cross1yellow
  cross2blue
  cross2green
  cross2red
  cross2yellow
  cross3blue
  cross3green
  cross3red
  cross3yellow
  cross4blue
  cross4green
  cross4red
  cross4yellow
  star1blue
  star1green
  star1red
  star1yellow
  star2blue
  star2green
  star2red
  star2yellow
  star3blue
  star3green
  star3red
  star3yellow
  star4blue
  star4green
  star4red
  star4yellow
  triangle1blue
  triangle1green
  triangle1red
  triangle1yellow
  triangle2blue
  triangle2green
  triangle2red
  triangle2yellow
  triangle3blue
  triangle3green
  triangle3red
  triangle3yellow
  triangle4blue
  triangle4green
  triangle4red
  triangle4yellow
  correct            
  error
  wcst_title
  instruction1
  instruction2
  instruction3
  tooslow

sounds
  good  # this sound file is taken from gnomebaker
  wrong # this sound file is taken is from tuxcart

# you can create a different table with wcst.r and include it here

table wcsttable
  include table.txt

# one line of the table consists of the following information
# column 1 : card
# column 2 : response (bitmap to be clicked 1 to 4)
# colomn 3 : response in previous task (or 0 if no previous task)
# column 4 : trial number in a task sequence, 1 is first, thus rule switch
# column 5 : name of the task 
# column 6 : stimulus description

task wcst
  delay 1000       # wait 1 second
  show bitmap circle1red     -175 -100  # bitmap number 1
  show bitmap triangle2green  -25 -100  # bitmap number 2
  show bitmap cross3blue      125 -100  # bitmap number 3
  show bitmap star4yellow     275 -100  # bitmap number 4
  show bitmap @1             -300  200  # bitmap number 5
  set $a 0         # once clicked, $a will be clicked-bitmap number 
  readmouse l @2 10000 range 1 4 # wait for left mouse click on rect 1-4 for 10sec
  set $a UNDER_MOUSE
  clear 5          # erase the last bitmap from screen
  if $a == 1       # if bitmap 1 was clicked, set variable newx to -175
    set $newx -175
  fi               # end of if statement
  if $a == 2
    set $newx -25
  fi
  if $a == 3
    set $newx 125
  fi
  if $a == 4
    set $newx 275
  fi
  if $a > 0 and STATUS != TIMEOUT
    show bitmap @1 $newx 25 # show the same card (6) underneath the one clicked
  fi
  delay 500                # keep it for 500 ms
  if STATUS == CORRECT     # if match was correct
    sound good             # give vocal feedback 
    show bitmap correct $newx 100  # show message "correct", bitmap 7
    clear -1
    delay 200
    show bitmap correct $newx 100  # show message "correct", bitmap 7
  fi
  if STATUS == WRONG       # if match was incorrect
    sound wrong            # give vocal feedback 
    show bitmap error $newx 100    # show message "error", bitmap 7
    delay 200
    hide -1
    delay 200
    unhide -1
  fi
  if STATUS == TIMEOUT     # if match was incorrect
    sound wrong            # give vocal feedback 
    show bitmap tooslow 75 100 # show message "timeout", bitmap 7
    delay 200
    clear -1
    delay 200
    show bitmap tooslow 75 100 # show message "error", bitmap 8
  fi
  delay 1000               # wait a second for feedback to be read/heard
  clear 6 7                # clear feedback card (6) and feedback message (7)
  ## determine what type of error this was
  set $anyerror 0
  set $nonperseverationerror 0
  set $perseverationerror    0  
  if STATUS != CORRECT
    set $anyerror 1
    if $a == @3
      set $perseverationerror 1
    fi
    if $a != @3
      set $nonperseverationerror 1
    fi
  fi
  save @1 @2 @3 @4 @5 @6 RT STATUS $a $anyerror $perseverationerror $nonperseverationerror

block wcstblock # there is just one block. Name it "wcstblock"
  message wcst_title
  pager instruction1 instruction2 instruction3
  task wcst 60 fixed # 60 trials, fixed follows order of table, is essential
  feedback
    set &NumErrors   sum c12
    set &PercErrors  perc ; select c12 == 1
    set &NumPers     sum c13
    set &PercPers    perc ; select c13 == 1
    set &NumNonPers  sum c14
    set &PercNonPers perc ; select c14 == 1
    text color yellow
    text align left
    text -200 -200  "Feedback on your WCST performance"
    text -200 -150  "(Note: There were in total 60 trials)"
    text -200  -50  &NumErrors   ; prefix "Error count:  "
    text  200  -50  &PercErrors  ; prefix "(" ; postfix "%)"
    text -200    0  &NumPers     ; prefix "Perseveration error count:  " 
    text  200    0  &PercPers    ; prefix "(" ; postfix "%)"
    text -200   50  &NumNonPers  ; prefix "Non-perseveration error count:  " 
    text  200   50  &PercNonPers ; prefix "(" ; postfix "%)"
    text -200  200  "Press space bar to continue"
  end

Download

If you have a PsyToolkit account, you can upload the zipfile directly to your PsyToolkit account. Watch a video on how to do that. If you want to upload the zipfile into your PsyToolkit account, make sure the file is not automatically uncompressed (some browsers, especially Mac Safari, by default uncompress zip files). Read here how to easily deal with this.

Further reading

  • Berg, E.A. (1948). Journal of Experimental Psychology, 38, 404-411. A simple objective technique for measuring flexibility in thinking. Journal of Experimental Psychology, 39, 15-22.

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

  • Milner, B. (1963). Effects of different brain lesions on card sorting: The role of the frontal lobes. Archives of Neurology, 9, 100-110.

  • Nyhus, E. & Barcelo, F. (2009). The Wisconsin Card Sorting Test and the cognitive asesment of prefrontal executive functions: A critical update. Brain and Cognition, 71, 437-451.