A customizable Sustained Attention to Response Task (SART; described in Robertson et al, 1997) measure, built with jsPsych.
Clone the repository:
git clone git@github.com:shamrt/jsSART.git
Clone the jsPsych submodule:
git submodule init
git submodule update
Install NodeJS packages:
npm install
Copy the Upstart configuration file (in etc/
) to /etc/init
, edit it as necessary, and make it executable:
cp etc/upstart.conf /etc/init/jssart.conf
chmod +x /etc/init/jssart.conf
Note: See howtonode.org if you have trouble.
Copy the Nginx configuration (modify it, too, as necessary):
cp etc/nginx.conf /etc/nginx/sites-enabled/jssart
Set file permissions:
chown -R www-data:www-data .
Start the project:
start jssart
To compile the raw data out by jsSART, run the following commands (note: python
[2.7], pip
, and virtualenv
are required).
First, setup your virtual environment:
virtualenv env
Next, activate it (note: you'll need to activate each time you open a new terminal window):
# in Linux
source env/bin/activate
# in Windows
env/Scripts/activate.exe
Next, install the required python packages:
pip install -r requirements.txt
Finally, run the Python script:
python scripts/compile_data.py
A CSV will be created/updated in the data
directory.
A "legend" explaining the variables generated by compile_data.py
can be found in the data
directory (variable-legend.xlsx
).
Note that the default practice trial conditions for this task replicate either (1) the number of trials from the jsPASAT task that came before it or (2) the duration of the trial blocks from the jsPASAT.
Also note that any changes made to survey questions or the core structure of the jsSART task may necessitate updates to the compile_data.py
script.
Unit tests for the data compilation code (along with mock data) can be run with the following:
py.test scripts
To watch tests (using pytest-watch
):
ptw scripts
And for JavaScript unit testing, go to /testing
in the browser.