Feedback will give a participant feedback about performance, for example about the average response times in a block. Feedback can be programmed in a "block" section only (and not on a trial by trial basis).

Feedback is not for PsyToolkit beginners. Feedback is an advanced feature of PsyToolkit experiment coding, and you should only use this once you have mastered the programming of more basic experiment aspects.

Background

Researchers might want to give participants feedback about their performance. Here are some reasons for feedback:

  • Feedback can motivate participants to respond more accurately or faster

  • Researchers might want to use the feedback when designing the task themselves (yet not give it in the end to the participants)

What you need to be able to give feedback

In order to use feedback for participants, you will need to makes sure you have thought about the following:

  • Which font would you want to use to present the feedback information in? Feedback will use the first specified font.

  • Which data do you want to give feedback about? You need to make sure you have saved this data using the "save" instruction in the task description.

  • What sort of feedback do you want to give? Most common is just to tell the user the number of mistakes they made or the average response speed.

Syntax

Note: The feedback instructions are given within the "block" statement.

There are currently 4 main components to give feedback. It is probably good to look first at the example below to get a quick impression (coding is often learned most quickly from looking at examples).

  • set

  • text

  • lineplot

  • xyplot

These are described in more detail below.

text

Text allows you to present variable values (the "set" command allows you to calculate averages, min, max, and percentages of participant responses).

Quotes around literal text in feedback is currently not required, although recommended. In the task show text command, quotes must be used!
Example of the text
    set &MyVar perc 10 ; select c4 == 1
    text  0 -150 &MyVar ; prefix "Percentage errors (should really be below 10%):" ; postfix "%"

You need to refer to the column of the datafile (in the example about we select the 5th column, the prefix c indicates the column. These are column of the datafile and not of the table!

There are a number of functions you can use:

  • mean The mean of a column in the datafile

  • min The minimum value of a colum in the datafile

  • max The maximum value of a colum in the datafile

  • sum The sum of all values in a colum in the datafile

  • count The total number of lines in a datafile

  • perc The percentage

set

You can set global variables (use the & sign). These are most likely variables you have not used in the tasks or blocks, although you can show those here too! The set command works slightly different in feedback, so follow the examples.

Example of set and text
feedback
  set &StroopCompatible mean c5 ; select c6 == 1
  set &StroopIncompatible mean c5 ; select c6 == 2
  set &MyStroopEffect expression &StroopIncompatible - &StroopCompatible
  text 0 -150 &MyStroopEffect ; prefix "Your Stroop compatibility effect:" ; postfix " ms"
end

In short, there are two types of "set" in the feedback:

1) The set with an expression to calculate new values to be shown. This is handy to show the difference between conditions like in the example above.

2) Set a global variable to the average, minimum, maximum, or percentage of errors of the value of a column in your datafile. Imagine that the 5th column of your datafile contains the response times, then you can do the following:

Example of set
feedback
  set &MyAverage mean c5
  set &MyAverage min c5
  set &MyAverage max c5
  set &MyAverage perc ; select c6 == 1
  set &MyAverage perc 100 ; select c6 == 1
end

Now imagine that column 6 contains the status, with 1 being correct, and anything else incorrect. Also imagine there are 200 trials in total. Now you can look for the percentage of correct trials, and you can calculate for correct trials only too:

Example of set
feedback
  set &MyAverage mean c5 ; select c6 == 1
  set &MySlowest min c5  ; select c6 == 1
  set &MyFastest max c5  ; select c6 == 1
  set &MyErrorRate perc  ; select c6 != 1
  text 0 -50 "Some feedback about your performance:"
  text 0 0  &MyAverage ; prefix "Average response time" ; postfix "ms"
  text 0 50 &MySlowest ; prefix "Slowest response time" ; postfix "ms"
  text 0 100 &MySlowest ; prefix "Slowest response time" ; postfix "ms"
  text 0 150 &MyErrorRate ; prefix "Error percentage" ; postfix "ms"
end
The feedback "perc" function can take an additional number, or you can leave that out. If you give the additional number, it will use that as the total, rather than the total number of trials. There are situations where this is useful.

lineplot and xyplot

The line and xyplot allows you to present the data points as a line plot on the screen. Currently, no examples available yet.

The semi-colon to separate sections of feedback commands must be surrounded by spaces (on both sides). Without this, it will be ignored.

Full example of a task with feedback

In this example participants respond with the "a" or "l" key to a left or right pointing arrow (a trial with a left-pointing arrow on the left in the image below). The feedback tells the participant how fast they were on average in correct trials, and what their error percentage was (example on the right in the image below).
The result
Feedback scripts look relatively cryptic at first, but they are very straightforward.
Example of how to use "feedback" in PsyToolkit script
# the following is an example of a Simon task with feedback about
# error rates and response times

bitmaps
  leftarrow
  rightarrow
  fixpoint

fonts
  arial arial.ttf 18

table simontasktable
  "L_pos L_arrow" -200 1 leftarrow   1
  "R_pos R_arrow"  200 2 rightarrow  2
  "R_pos L_arrow"  200 3 leftarrow   1
  "L_pos R_arrow" -200 4 rightarrow  2

task simon
  table simontasktable
  keys a l
  show bitmap fixpoint
  delay 100
  show bitmap @4 @2 0
  readkey @5 2000
  delay 5000
  save BLOCKNAME @1 @3 TABLEROW KEY STATUS RT

block mytrainingblock
  tasklist
    simon 20
  end
  feedback
    set &MyPerc          ; select c7 != 1
    set &MyMean mean c8  ; select c7 == 1
    set &MyCount count   ; select c7 == 1
    text 0 -250  "Error percentage and response times in training block"
    text 0 -200  "(in ms = milliseconds = there are 1000 ms in one second)"
    text 0 -150 &MyPerc  ; prefix "Percentage errors (should really be below 10%):" ; postfix "%"
    text 0 -100 &MyMean  ; prefix "Average speed of ALL CORRECT RESPONSES:" ; postfix "ms"
    text 0 -50  &MyCount ; prefix "Total number of correct trials:"
    text 0  200  "This was just training. Now press space bar of your keyboard"
    text 0  250  "with the REAL data collection (will take about 5 minutes)"
  end
  wait_for_key