Skip to content

jspsych/jspsych-contrib

Repository files navigation

jspsych-contrib: jsPsych community contributions

This is an open repository of jsPsych plugins and extensions developed by members of the jsPsych community. If you've written a jsPsych plugin or extension that you think others might be interested in using, this is the place to share it!

jspsych vs. jspsych-contrib

Plugins and extensions in the main jsPsych repository are maintained by the core jsPsych team. The team takes responsibility for fixing bugs and updating plugins to take advantage of new features in jsPsych.

Plugins and extensions in this jspsych-contrib repository are contributed by community members. They are not extensively tested or verified by the core jsPsych team, and there is no guarantee that anyone will be available to fix bugs, push updates, or answer questions about these plugins/extensions. However we would encourage contributors to respond to issues/questions and to maintain their code.

Contributions to jspsych-contrib that are broadly useful, well-documented, and well-tested may be added to the main jsPsych repository, with the contributor's permission.

List of available plugins

The jsPsych plugins that have been contributed by community members can be found in the /packages directory. The /packages directory also contains four template sub-folders that can be used as a starting point for contributing a plugin/extension (see the Guidelines for contributions section).

Plugins

Plugin Contributor Description
audio-multi-response Adam Richie-Halford This plugin collects responses to an audio file using both button clicks and key presses.
audio-swipe-response Adam Richie-Halford This plugin collects responses to an audio file using swipe gestures and keyboard responses.
bart Josh de Leeuw The balloon analogue risk task (BART) measures risk-taking behavior through a simple balloon-pumping simulation with risk of explosion.
columbia-card-task Josh de Leeuw The Columbia Card Task measures risk preferences through choices in a card game.
copying-task Andre Sahakian A plugin for running a copying task: a model grid on the left has to be recreated in the middle grid, using items from the right grid.
corsi-blocks Josh de Leeuw This plugin displays a configurable Corsi blocks task and records a series of click responses.
flanker Josh de Leeuw A jsPsych plugin for the Eriksen Flanker Task. Displays a configurable flanker array with precise SOA timing and supports arrows, letters, numbers, or custom stimuli. Includes keyboard and mobile-friendly button response modes.
gamepad Shaobin Jiang This plugin allows one to use gamepads in a jsPsych experiment.
html-choice Younes Strittmatter This plugin displays clickable html elements that can be used to present a choice.
html-keyboard-response-raf Josh de Leeuw This plugin uses the same functionality as the html-keyboard-response plugin, but uses requestAnimationFrame internally for timing
html-keyboard-slider Max Lovell Sliders which allow for keyboard responses.
html-multi-response Adam Richie-Halford This plugin collects responses to an arbitrary HTML string using both button clicks and key presses.
html-swipe-response Adam Richie-Halford This plugin collects responses to an arbitrary HTML string using swipe gestures and keyboard responses.
html-vas-response Isaac Kinley This plugin collects responses to an arbitrary HTML string using a point-and-click visual analogue scale.
image-array-keyboard-response Younes Strittmatter This plugin displays an arbitrary number of images and records responses generated with the keyboard.
image-click-response Christophe Bossens This plugin shows an image on which the user can place points by clicking/touching the image. The location of each point is recorded as data.
image-hotspots Josh de Leeuw A plugin for displaying an image with clickable regions
image-multi-response Adam Richie-Halford This plugin collects responses to an image stimulus using both button clicks and key presses.
image-swipe-response Adam Richie-Halford This plugin collects responses to an image stimulus using swipe gestures and keyboard responses.
ios Isaac Kinley This plugin implements a continuous version of the Inclusion of Other in the Self (IOS) Scale (Aron et al., 1992).
libet-intentional-binding Isaac Kinley This plugin measures intentional binding using a Libet clock, and allows the participant to estimate the timing of events by adjusting the clock hand themselves.
nextcloud-filedrop C. Martin Grewe This plugin provides permanent storage of data collected during an experiment using a nextcloud instance.
pipe Josh de Leeuw jsPsych plugin to faciliate communication with DataPipe
rdk Josh de Leeuw This plugin displays a Random Dot Kinematogram (RDK) and allows the subject to report the primary direction of motion by pressing a key on the keyboard.
rok Younes Strittmatter This plugin displays a Random Object Kinematogram (ROK) and allows the participant to report the primary direction of motion or the primary orientation by pressing a key on the keyboard.
self-paced-reading igmmgi Self-paced reading tasks with different display options.
slide-to-continue Vishnu Lakshman The plugin-slider is a jsPsych plugin that creates an interactive slider interface similar to the 'slide to unlock' functionality found on mobile devices. Users must drag a slider handle to complete the trial, making it useful for consent screens, engagement checks, or transition screens in psychological experiments.
spatial-nback A. Hunter Farhat A jsPsych plugin for presenting a spatial grid stimulus, designed for spatial n-back tasks. The plugin displays a customizable grid, highlights a cell as the stimulus, and collects participant responses with optional feedback and instructions.
spr jade Self-paced reading trials using the DOM.
survey-number Josh de Leeuw This plugin displays a survey question and collects a numeric response.
survey-slider Dominique Makowski Add several analogue scales on the same page for use in questionnaires.
survey-vas Isaac Kinley This plugin displays a series of questions with point-and-click visual analogue scales.
video-hotspots Josh de Leeuw A plugin for displaying a video that freezes on the final frame with clickable hotspots
video-several-keyboard-responses Maria Emine Nylund jsPsych plugin for playing a video file and getting several keyboard responses
vsl-animate-occlusion Josh de Leeuw The VSL (visual statistical learning) animate occlusion plugin displays an animated sequence of shapes that disappear behind an occluding rectangle while they change from one shape to another.
vsl-grid-scene Josh de Leeuw The VSL (visual statistical learning) grid scene plugin displays images arranged in a grid.

Extensions

Extension Contributor Description
countdown Shaobin Jiang This extension adds a countdown during a trial.
device-motion Pedro Neto jsPsych extension for tracking device motion
mediapipe-face-mesh C. Martin Grewe This extension provides online tracking of facial posture during trials using the MediaPipe Face Mesh library.
touchscreen-buttons Younes Strittmatter This extension displays touch buttons that allow the participant to respond to stimuli via a touchscreen on mobile devices.

Guidelines for contributions

Contribution requirements

Contributions to this repository must:

  • Work as described
  • Include the complete code for the plugin or extension.
  • Include a README.md file following our template (identical for plugins and extensions).
  • Include a package.json file.

Optionally, contributions are encouraged to include:

  • A /docs directory with documentation matching the template for docs on jspsych.org
  • An /examples directory with a working .html demo.
  • A test suite following the testing framework in our -ts templates (plugin test template; extension test template).

To contribute a new plugin or extension to this repository, follow these steps:

  1. Clone this repository on your machine and run npm i to install its packages.
  2. Run npx @jspsych/new-plugin or npx @jspsych/new-extension and answer the prompts to create a new plugin/extension template under /packages. This is a command-line tool we built to make setting up the development of a new plugin/extension easier. Documentation for using this tool can be found in their respective readme files (new-plugin; new-extension).
  3. After you are done editing the plugin/extension template, verify that it works by opening examples/index.html in your browser.
  4. Run npm i in your plugin/extension directory to install all your dependencies.
  5. Add a changeset by running npm run changeset in the main directory of the repository. This will prompt you for a description of the changes you made and creates a new changeset file in the changesets directory accordingly.
  6. Open a pull request to merge your branch into the main branch of this repository.

In the pull request comments, please make it clear how we can verify that the contribution is functional. This could be accomplished with a link to a demonstration experiment, the inclusion of an example file and/or testing files, or through some other means. We try to review pull requests quickly and add new contributions as soon as the minimal standards are met.

Creating a new plugin or extension

We have a tool for building new plugins and extensions at jspsych-dev, with instructions for using the tools at the repository's README.md.

You may also want to read the jsPsych documentation on plugin development to understand how to work with the index.ts file (for TypeScript development) and index.js file (for JavaScript development).

jsPsych version compatibility

We would like to encourage you to contribute plugins and extensions that are compatible with jsPsych v7+, as this will make your contributions maximally accessible to other jsPsych users. jsPsych has gone through major changes in upgrading to v7 and later versions, so it will be difficult to maintain backwards compatability for plugins/extensions using versions earlier than v7.

At the same time, we realize that there may be jsPsych users who have created very useful plugins/extensions with jsPsych v6 that they would like to share with the community, but don't know how to or have the time/resources to convert their contributions into the jsPsych v7+ Node package format.

As a first step to helping make this conversion easier, we offer a general migration guide for v6.x to v7.x and for v7.x to v8.x. If you have suggestions/requests for additional documentation on migration, please open a thread on our discussion board.

About

An open repository of jsPsych plugins and extensions, without any official support

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 29