Pushkin
Search…
Lexical decision template
To install this experiment template, use the command pushkin install experiment, then select lexical.
Lexical decision experiment template, with corrective response set to true.

config.js

When correctiveFeedback is set to true, the bounding box will change color to indicate correctness - green meaning correct, and red meaning incorrect. If set to false, the box remains black.

stim.js

word_1: Word displayed on top in fixation box
word_2: Word displayed on bottom in fixation box
both_words: If true, 'Y' is the correct answer (both word_1 and word_2 are real words). If false, one or both of the words is not a real world and the correct answer is 'N'
related: If true, the words are related to each other (e.g. leaf and tree). If false, the words are unrelated (e.g. sock and tree).

Example: Customizing a lexical decision experiment

Finding experiment files to modify

If you have installed an experiment using the lexical decision experiment template and called it lex, you should have a directory called lex in your experiments folder. This directory should be structured like this:
1
lex
2
├── api controllers
3
├── config.yaml
4
├── LICENSE
5
├── migrations
6
├── package-lock.json
7
├── README.md
8
├── web page
9
└── worker
Copied!
In order to customize your simple lexical decision experiment, you will need to access two files, config.js and stim.js. These files can be found in web page/src/, a directory that looks like this:
1
src
2
├── assets
3
├── config.js
4
├── consent.js
5
├── debrief.js
6
├── experiment.js
7
├── index.js
8
└── stim.js
Copied!

Modifying the experiment configuration and stimuli files

Modifying config.js

This file controls the aesthetics of your experiment, including font color, font size, and font family. If you wanted to set the font color to red, set the font size to 20px, and set the font family to a monospace font such as Courier New, you would modify config.js as follows:
1
// Custom stylin'
2
3
var experimentConfig = {
4
fontColor: "red",
5
fontSize: "20px",
6
fontFamily: "'Courier New', Courier, monospace",
7
correctiveFeedback: "true"
8
}
9
10
export default experimentConfig;
Copied!
You'll notice that 'Courier New' is not the only fontFamily's only specification. This is because it's important to list backup fonts in case your preferred font can't be loaded. You can read more about this practice here and see other CSS font combination ideas here.
You'll also notice that correctiveFeedback is set to true. You can change this to false so that participants don't receive any feedback. Once you make this change, your final config.js should look like this:
1
// Custom stylin'
2
3
var experimentConfig = {
4
fontColor: "red",
5
fontSize: "20px",
6
fontFamily: "'Courier New', Courier, monospace",
7
correctiveFeedback: "false"
8
}
9
10
export default experimentConfig;
Copied!
You can run pushkin prep and pushkin start; to see your changes.

Modifying stim.js

This file controls the stimuli presented to participants. It specifies not only (1) what two words should be presented on the screen (word_1 and word_2), but also (2) whether both words are true words (both_words), and (3) whether the two words are related to each other (related).
Say you have created the following table of stimuli for your experiment.
word_1
word_2
both_words
related
FLOWER
PETAL
true
true
BALL
NET
true
true
DOG
LEASH
true
true
COMB
BRUSH
true
true
BABY
BEAN
true
false
CAGE
FERN
true
false
DOG
FLOUR
true
false
GOAT
SAND
true
false
VASE
VATE
false
false
ARM
ARL
false
false
COAT
COET
false
false
HAIR
HAIP
false
false
HAME
HAMA
false
false
DAKE
GRAKE
false
false
CLEB
CLED
false
false
AFTY
AFLY
false
false
In order to be able to use these stimuli in the lexical decision experiment, you must use a table to JSON converter such as this one to format it correctly for jsPsych.
Once it has been converted, paste the JSON into the stim.js file, which should now look like this:
1
// Example stimuli
2
3
const stimArray = [
4
5
{word_1: 'FLOWER', word_2: 'PETAL', both_words: true, related: true},
6
{word_1: 'BALL', word_2: 'NET', both_words: true, related: true},
7
{word_1: 'DOG', word_2: 'LEASH', both_words: true, related: true},
8
{word_1: 'COMB', word_2: 'BRUSH', both_words: true, related: true},
9
{word_1: 'BABY', word_2: 'BEAN', both_words: true, related: false},
10
{word_1: 'CAGE', word_2: 'FERN', both_words: true, related: false},
11
{word_1: 'DOG', word_2: 'FLOUR', both_words: true, related: false},
12
{word_1: 'GOAT', word_2: 'SAND', both_words: true, related: false},
13
{word_1: 'VASE', word_2: 'VATE', both_words: false, related: false},
14
{word_1: 'ARM', word_2: 'ARL', both_words: false, related: false},
15
{word_1: 'COAT', word_2: 'COET', both_words: false, related: false},
16
{word_1: 'HAIR', word_2: 'HAIP', both_words: false, related: false},
17
{word_1: 'HAME', word_2: 'HAMA', both_words: false, related: false},
18
{word_1: 'DAKE', word_2: 'GRAKE', both_words: false, related: false},
19
{word_1: 'CLEB', word_2: 'CLED', both_words: false, related: false},
20
{word_1: 'AFTY', word_2: 'AFLY', both_words: false, related: false}
21
]
22
23
export default stimArray;
Copied!
Run pushkin prep and pushkin start; again, and your experiment should be ready to go!
Last modified 1yr ago