This task is built with the jsPsych 7.3 library using TypeScript. The source code of the experiment is located under the src directory. The jsPsych experiment timeline is setup in index.ts. The jsPsych plugin is defined in plugin.ts. Interoperability across online and in-person delivery is enabled using the Neurocog.js package.
The experimental and Neurocog.js configuration is defined in index.ts, and other utility functions are defined in functions.ts. The classes subdirectory containes class definitions for core components of the RDK stimuli and plugin runtime classes. The css subdirectory contains styling definitions, and the img subdirectory contains stimuli used in the experiment.
Unit tests are defined in the test directory, and the TypeScript type definitions are contained in the types directory.
This project uses yarn to manage dependencies. Install dependencies using the yarn command.
To start a development server that will rebuild the code on any changes, run yarn start. The task can be accessed at localhost:8080.
To run unit tests, run yarn test. To execute the code styling utility on all source code, run yarn style. To clean up build artefacts, run yarn clean.
To deliver this task online or offline, run yarn build to generate a minimised and bundled output in the dist subdirectory that includes all stimuli, source code, and an index.html file.
To deliver this task offline, open index.html in a browser of choice. To deliver this task online, upload the index.bundle.js output file to a Gorilla project. Additional configuration will be required for the Gorilla project, and further documentation about online delivery can be found with the Neurocog.js package.
To deliver this task offline in a spectrometer, adjust the key layout defined in index.ts to map the signals generated by spectrometer controllers. Run yarn build:spectrometer to generate output with updated button icons and key layouts to suit spectrometer delivery and controller interaction. This task requires a minimum of four physical buttons for playing the game and a signal signifying spectrometer data collection.
Important
When using the Current Designs button box, set the following Output modes for the corresponding task version:
- v1.8.2 and higher: Set Output mode to
HID_NAR_12345 - v1.8.1 and earlier: Set Output mode to
HID_KEY_12345
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Please contact Henry Burgess <henry.burgess@wustl.edu> for all code-related issues and feedback.