Self-paced-reading task
This documentation describes only one part of an experiment. For other tasks, see the related pages.
Self-paced reading
The self-paced reading paradigm is a method used in psycholinguistics to study sentence processing. Participants read a sentence in word-by-word or phrase-by-phrase, pressing a button to reveal each segment. In this implementation, the sentence segments that were revealed, disappear as soon as the next segment is displayed.
Self-paced reading experiments record the time spent reading each segment. This allows researchers to gauge how difficult or easy it is for participants to process different parts of the sentence. Differences in reading time between help to understand the cognitive mechanisms underlying the processing of language.
Self-paced reading experiments are often accompanied by forced-choice comprehension questions or an acceptability judgment task.
Overview
This code sets up an online psycholinguistic experiment using PCIbex, handling participant instructions, displaying reading materials, inserting comprehension questions with attention checks, and tracking accuracy.
The structure of the code is as follows:
- Setup and Configuration
- Experiment Structure (order of the experiment stages)
- Set Latin square group/select list
- Exercise
- Start of main experiment notice:
"start_experiment"
- Main experiment:
rshuffle("experiment-filler", "experiment-item")
- Sending results:
SendResults()
- List counter
- Start of experiment notification
- Experiment trial structure
Dependencies
- Resources
items.csv
list of exercise stimuli
- Scripts
main.js
- Aesthetics
global_main.css
PennController.css
SelfPAcedReadingParadigmSentence.css
- Modules
PennController.js
SelfPAcedReadingParadigmSentence.js
Other modules and aesthetics may be necessary if your experiment uses other trials, e.g. a form for recording participant information.
Stimulus file
The column names and their capitalization matters. If you change the column names and file name, adjust your code accordingly.
The stimuli file items.csv
has the following structure as in the table below. The column names and their capitalization matters.
ITEM
: the item IDCONDITION
: the condition IDSENTENCE
: the sentence to be displayed during self-paced reading; sentence segment boundaries are indicated by*
LIST
: the list ID or Latin square group, used for experiment version presentationTYPE
: the stimulus type (exercise
,item
, orfiller
)- exercise: shown only during the exercise trials in random order
- item and filler: shown only during the main experiment trials in pseudorandomized order
In the exercise, the sentences are presented in random order. In the main experiment, the sentence order is randomized and the filler order is randomized. Then, the items and fillers are shuffled in a random order.
ITEM | CONDITION | SENTENCE | LIST | TYPE |
---|---|---|---|---|
1 | 1 | Andrea*war*abweisend,*um*das Date*schneller*zu beenden. | 1 | item |
1 | 2 | Anja*war*aggressiv,*um*die Rivalin*zu irritieren. | 2 | item |
2 | 2 | Svenja*war*barbarisch,*um*die Wikinger*für sich*zu gewinnen. | 1 | item |
2 | 1 | Clara*war*bescheiden,*um*die Stiefmutter*von sich*zu überzeugen. | 2 | item |
1001 | 1001 | Henrike*fuhr*nach Brasilien. | 1 | filler |
1001 | 1001 | Henrike*fuhr*nach Brasilien. | 2 | filler |
1002 | 1001 | Die Polizei*bat*um Hilfe. | 1 | filler |
1002 | 1001 | Die Polizei*bat*um Hilfe. | 2 | filler |
2001 | 0 | In Internetforen*diskutierten*Eltern. | 1 | exercise |
2001 | 0 | In Internetforen*diskutierten*Eltern. | 2 | exercise |
2002 | 0 | Beide Einrichtungen*wurden*von Freiwilligen betrieben. | 1 | exercise |
2002 | 0 | Beide Einrichtungen*wurden*von Freiwilligen betrieben. | 2 | exercise |
Self-paced reading code
The self-paced reading procedure is governed by 3 files: the SelfPacedReadingParadigmSentence.js
module, the SelfPacedReadingParadigmSentence.css
style file, and the trial setup in main.js
.
Phrase-by-phrase presentation
The main.js
file must contain a variation of the following code:
// Trial
// display a primer that can be clicked away by pressing space bar
;
"items.csv", "experiment-"+row.TYPE,
,
"SelfPacedReadingParadigmSentence",
"list" , row.LIST
"item" , row.ITEM
"condition" , row.CONDITION
;
This code snippet is structured to conduct a series of experimental trials. Within a single trial, participants navigate by pressing the SPACE
bar. The participants:
- See a primer (e.g. a fixation point
*
) - For each row in a
items.csv
, a new trial is created with a sentence displayed. The letters are substituted for underscores_
. - The sentence is split at designated points (indicated by asterisks
*
) for self-paced reading. - After each pressing of the space bar, the previous sentence segment is obscured and the next one is revealed.
- Additional trial information is logged (list, item, and condition). This information is logged based on the values in the corresponding columns of
items.csv
for each row (currently displayed sentence).
Word-by-word presentation
To change the presentation to word-by-word, you need to make 2 changes to your experiment.
In the main.js
file, substitute *
for an empty space:
"SelfPacedReadingParadigmSentence",
In the stimulus CSV
file, replace *
for empty spaces:
ITEM | CONDITION | SENTENCE | LIST | TYPE |
---|---|---|---|---|
1 | 1 | Andrea war abweisend, um das Date schneller zu beenden. | 1 | item |
Optional: Start experiment screen
This code sets up the beginning of an experiment by initializing a new trial and displaying a message to the participants that indicates the experiment is starting. It separates the exercise trials from the main experiment. The participants must click on the button "Continue" to proceed to the next part of the experiment.
// Start experiment screen
"start_experiment" ,
"The main experiment begins now."
,
"go_to_experiment", "Continue"
;
Running Code
To run the code, clone/download the content of the GitHub repository and copy it into a new empty project in your PCIbex farm. Alternatively, click on the demo link (phrase-by-phrase, word-by-word) and clone the template.