A jsPsych experiment for a delayed match-to-sample visual memory task using naturalistic image stimuli.
This repository contains the Stage 3 experiment infrastructure for a broader stimulus-development and validation pipeline.
Participants view naturalistic images, maintain them in memory across a delay, and then make a choice response between a target and a similar foil. The task is implemented in jsPsych and can be run locally for development or packaged for JATOS deployment.
This project sits within a three-stage workflow:
- Stage 1: synthesis and model-based perceptual scaling of the stimulus set
- Stage 2: psychophysical validation via similarity judgments
- Stage 3: behavioral validation in a delayed match-to-sample memory task
This repository covers Stage 3.
Reference:
Pettini, L., Bogler, C., Doeller, C., & Haynes, J.-D. (2025). Synthesis and perceptual scaling of high-resolution naturalistic images using Stable Diffusion. Behavior Research Methods, 58(1), 24. https://doi.org/10.3758/s13428-025-02889-8
src/: experiment logic and configurationstyles/: SCSS styles used by the taskassets/design_batches/: JSON design files used to assemble trialsassets/stimuli_task/: image stimuli used in the taskassets/ui/: consent form and instructional images
- Node.js
- npm
The task is configured to require Google Chrome for participants at runtime.
Install dependencies:
npm installStart the local development server:
npm run startBuild the experiment:
npm run buildBuild a JATOS package:
npm run jatosThe main configuration lives in src/experiment_config.js.
By default, the public repository is safe to run locally:
- backend integration is disabled
- no live production endpoints are committed
- the task falls back to a local default design file
If you want to use your own private backend, inject runtime configuration before the app bundle loads:
<script>
window.VISUAL_MEMORY_TASK_CONFIG = {
backend: {
enabled: true,
getDesignUrl: "https://your-private-backend.example.com",
sendAssignmentUrl: "https://your-private-backend.example.com/"
}
};
</script>
<script defer src="js/app.js"></script>Important:
- the config script must appear before
js/app.js - this private config should live only in your deployment, not in the public repository
- frontend configuration is not a true secret, so backend-side access controls are still recommended
This repository is intentionally set up so that publishing it does not expose live backend endpoints in source control. For production use, prefer deployment-time configuration rather than hardcoding service URLs into the repo.
- Review the consent materials and institutional branding in
assets/ui/ - Large generated folders such as
node_modules/,.jspsych-builder/, andpackaged/are ignored and should not be committed - The stimulus assets are large, so clone and hosting size should be considered
- No open source license is currently included; add one if you want to grant reuse permissions