https://github.com/brain-development-and-disorders-lab/jspsych-attention-check
A jsPsych plugin for adding multiple-choice attention check questions to an experiment timeline.
https://github.com/brain-development-and-disorders-lab/jspsych-attention-check
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (8.0%) to scientific vocabulary
Repository
A jsPsych plugin for adding multiple-choice attention check questions to an experiment timeline.
Basic Info
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 23
Metadata Files
README.md
jspsych-attention-check
A jsPsych plugin for creating attention-check questions.
🚨 As of version 3.0.0, this package is only compatible with jsPsych v7.0+. For use with earlier versions, version 2.1.1 of this package is compatible with jsPsych v6.3.
Install this package (jsPsych v7.0+):
Shell
npm install jspsych-attention-check@^3.0.0
Shell
yarn add jspsych-attention-check@^3.0.0
Install this package (recommended for jsPsych v6.3):
Shell
npm install jspsych-attention-check@2.1.1
Shell
yarn add jspsych-attention-check@2.1.1
Overview
This plugin allows two styles of attention-check questions to be displayed, while supporting keyboard input schemes for the radio button display style. Additional features include an input timeout, rich feedback capabilities, and the ability to ask the participant for confirmation before submitting their response.
The plugin makes use of React and the Grommet UI library, an accessibility-first library that provides a number of useful components. Given that jsPsych experiments may not use React, the plugin will clean up after itself to ensure there are no issues mixing a React-based component with a non-React experiment.
Parameters
| Name | Type | Required? | Description | Example |
| --------------- | ---------------------------------------------------------- | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| prompt | string | Yes | The prompt to be presented to the participant. | |
| responses | {value: string, key: string \| null, correct: boolean}[] | Yes | A list of response objects that the participant can select as their answer to the attention-check prompt. Each response object requires three parameters: value: The displayed text of the option; key: If the attention-check questions use keyboard input only, specify the corresponding keycode here. If not, this value should always be null; and correct: Boolean to mark if this response is the correct response or not. There can only be one correct response in each collection of responses. | [{value: "Response A", key: "1", correct: true}, {value: "Response B", key: "2", correct: false}] |
| continue | {confirm: boolean, key: string \| null} | Yes | Optionally display a confirmation message before submitting a selected response. | {confirm: true, key: " "} |
| feedback | {correct: string, incorrect: string} | Yes | Specify feedback to be presented depending on a correct or incorrect answer. | {correct: "Correct feedback.", incorrect: "Incorrect feedback."} |
| style | radio or default | No (default: default) | Change the display style of the responses. radio displays the responses as a set of radio buttons, and is the only display format supporting keyboard input configuration. default displays the options as a drop-down list. | |
| input_timeout | number | No (default: 0) | Specify an input timeout that must expire before a participant is permitted to interact with the attention-check question. | 1000 |
Data
Three data points are collected: attentionRT, attentionSelected, attentionCorrect:
attentionRT(number): a float representing the time taken by the participant to select an option once input is permitted. Measured in milliseconds.attentionSelected(string): a string containing the value of the response selected by the participant.attentionCorrect(boolean): a boolean representing the correctness of the participant's response.
Example Usage
You can add an attention-check to your jsPsych v7.0+ timeline like any other timeline node. The following example displays responses as a radio button group, and uses keyboard input only.
javascript
timeline.push({
type: jsPsychAttentionCheck,
prompt: "Why is 6 afraid of 7?",
responses: [
{ value: "Because 7 is even and 6 is not.", key: "1", correct: false },
{ value: "Because 7 is a better number.", key: "2", correct: false },
{ value: "Because 7 8 9!", key: "3", correct: true },
],
style: "radio",
continue: {
confirm: true,
key: " ",
},
feedback: {
correct: "Correct!",
incorrect: "Incorrect.",
},
});
The following example displays responses as a drop-down, does not use keyboard input, and does not require confirmation.
javascript
timeline.push({
type: jsPsychAttentionCheck,
prompt: "Why is 6 afraid of 7?",
responses: [
{ value: "Because 7 is even and 6 is not.", key: null, correct: false },
{ value: "Because 7 is a better number.", key: null, correct: false },
{ value: "Because 7 8 9!", key: null, correct: true },
],
style: "default",
continue: {
confirm: false,
key: null,
},
feedback: {
correct: "Correct!",
incorrect: "Incorrect.",
},
});
Owner
- Name: Brain Development and Disorders Lab
- Login: Brain-Development-and-Disorders-Lab
- Kind: organization
- Email: corpuscallosumresearch@wustl.edu
- Location: United States of America
- Website: https://sites.wustl.edu/richardslab
- Twitter: ccd_research
- Repositories: 3
- Profile: https://github.com/Brain-Development-and-Disorders-Lab
Brain Development and Disorders Lab at Washington University School of Medicine, Department of Neuroscience, St. Louis MO
GitHub Events
Total
- Release event: 3
- Delete event: 1
- Push event: 12
- Pull request event: 2
- Create event: 6
Last Year
- Release event: 3
- Delete event: 1
- Push event: 12
- Pull request event: 2
- Create event: 6
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 0
- Total pull requests: 7
- Average time to close issues: N/A
- Average time to close pull requests: 1 minute
- Total issue authors: 0
- Total pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 7
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 1
- Average time to close issues: N/A
- Average time to close pull requests: 1 minute
- Issue authors: 0
- Pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
- henryjburg (5)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- @types/react ^18.0.10 development
- @types/react-dom ^18.0.5 development
- parcel ^2.0.0-rc.0 development
- prettier ^2.6.2 development
- grommet ^2.24.0
- grommet-icons ^4.7.0
- jspsych 6.3
- polished ^4.2.2
- react ^18.1.0
- react-dom ^18.1.0
- react-key-icons ^1.0.1
- styled-components ^5.3.5
- usehooks-ts ^2.5.4
- 731 dependencies