This repository hosts a browser-based research task for online data collection. The task is built with HTML, CSS, JavaScript, and jsPsych. GitHub Pages serves the task files, and jsPsych DataPipe saves participant responses to the approved private OSF storage location.
This repository should contain only task code and public assets. Participant data, exported response files, and local notes should not be committed.
The hosted task runs from GitHub Pages. Recruitment links should be configured in the recruitment platform, with participant metadata passed through URL parameters.
DataPipe is configured in src/stimuli.js under dataPipe. When data
collection is enabled in DataPipe, the task saves two files after the last
questionnaire page and before the debriefing page:
- a CSV file containing the full jsPsych trial data;
- a summary CSV file containing readable fields for screening and tracking.
The filename format is:
<study_name>_<participant_id>_<timestamp>.csv
<study_name>_<participant_id>_<timestamp>_summary.csv
The participant identifier is read from participantId first, then
participant_id, then id. If no identifier is present, the filename uses
unknown.
If DataPipe validation rules are enabled, they must allow every file the task sends. A validation mismatch prevents OSF upload. For initial testing, validation can be disabled on the DataPipe dashboard; once the final data format is fixed, validation can be re-enabled with matching required fields.
The task accepts optional URL parameters for launch and testing:
participantId: participant identifier from the recruitment platform.assignmentId: assignment or submission identifier from the recruitment platform.projectId: recruitment-project identifier.completionUrlorcompletion_url: approval/return URL from the recruitment platform.condition: manually sets a valid task condition for testing.fast=1: uses shortened timing and relaxed response requirements for testing.datapipe=0: turns off DataPipe saving for local testing.datapipe=1: turns on DataPipe saving when the config is disabled.download=1: downloads a local CSV copy at completion.cachebust=<value>: forces the browser to load the newest deployed files.
From the repository root, start a local static server:
python3 -m http.server 8000Then open:
http://localhost:8000/
For a short local test that does not save to DataPipe:
http://localhost:8000/?participantId=test001&fast=1&datapipe=0
For a short local test that does save through DataPipe:
http://localhost:8000/?participantId=LOCAL_DATAPIPE_TEST&fast=1&datapipe=1
Updates are published by committing changes to the main branch and pushing to
GitHub. GitHub Pages rebuilds automatically after each push.
git add .
git commit -m "Describe the update"
git pushBrowser caching can make old versions appear after deployment. A hard refresh or
a cache-busting query parameter such as ?cachebust=1 can force a fresh load.
Data are not stored on GitHub Pages or in this repository. Successful participant sessions should appear in the linked private OSF storage location configured through DataPipe. If the final page shows a data save error, the browser tab should be left open while the issue is investigated. DataPipe stores files in the OSF component configured for the experiment, not necessarily in the top-level OSF project files area.