In this experiment, you see an image and need to rate it on a scale from 1 to 5.

For this, we use the built-in rate function of PsyToolkit.

Running the code

First run the experiment to see what it does.

The PsyToolkit code

bitmaps
  instructions
  left
  right
  selection_item
  dog
  cat
  fish

table my_table
  "cute cat"  cat
  "cute dog"  dog
  "scary fish" fish

task rate_animal
  show bitmap @2 0 -100
  rate option pos 0 200
  rate option labels left right
  rate option items selection_item
  rate 10000 5
  save @1 RATE RATE_RT RATE_STATUS

block test
  message instructions mouse
  tasklist
    rate_animal 3 fixed
  end

Code explained

This is actually a very basic experiment.

On each trial, a bitmap is shown.

The rate options specify the following:

Tell the computer where the rate scale is shown (X/Y), in this case, 200 pixels below screen center
rate option pos 0 200
Tell the computer which images to show left and right from the scale
rate option labels left right
Tell the computer what the clickable items of the Likert scale look like (in this case, selection_item is a bitmap of a yellow circle)
rate option labels selection_item
Tell the computer to wait maximally 10 seconds and show 5 points on the Likert scale
rate option labels selection_item
Tell the computer to save the chosen point (between 1 and 5 in this case), the RT, and the STATUS
save RATE RATE_RT RATE_STATUS

Thus, the output data file will on each line have first the string in the table with the condition (cute or scary) followed by the name of the stimulus (cat, dog, fish) and then the Likert score (1 to 5), the reaction time, and the status (1=responded within time, 3=timeout).