OCP
is an example version of the frontend code for the Object Contact Predition Task. It will need a webserver (app.js
) to serve it (but it can be used to collect data). This task was used in Physion: Evaluating Physical Prediction from Vision in Humans and Machines (NeurIPS, 2021).
Here, instead of a database, a local .json
in stimuli/
is used to read session templates and the results are saved into a .csv
in results/
.
To run the experiment, run node app.js --gameport PORT
where PORT is the port number you want to use. If don't want to use the mongoDB backend, run node app.js --gameport PORT --local_store
.
Note that --local_store
IS ONLY MEANT FOR TESTING PURPOSES—DO NOT USE THIS FOR LARGE SCALE DATA COLLLECTION.
This needs to be ran from the experiments folder (ie. run cd experiments
before running this).
Only one version of app.js
needs to be run for all experiments.
The experiments are opened by using https://SERVER.TLD:PORT/experiment/index.html?projName=PROJ&expName=EXP&iterName=ITER
where SERVER.TLD
is the server name, PORT
is the port number, PROJ
is the project name, EXP
is the experiment name, and ITER
is the iteration name.
For the example here, we are using the following values:
Parameter | example value |
---|---|
project name | BACH |
experiment name | domninoes_OCP |
iteration_name | iteration_1 |
Here, we would use https://cogtoolslab.org:8881/dominoes/index.html?projName=BACH&expName=dominoes_OCP&iterName=it1.
Troubleshooting:
- the study is set up to require a secure connection, so
https://
needs to be used. - app.js runs from a particular port that may be separate from the default HTML port, so the port needs to be specified (eg.
:8881
). /index.html
needs to be opened by the browser, otherwise a blank page will be returned.- Data must be in the
input
database, otherwise a blank page is shown. Use the stdio output of app.js and the browser JavaScript console to troubleshoot.
- Complete your OSF pre-registration worksheet
- Make sure that data is being saved correctly by drafting your analysis notebook
- Write instructions
- Figure out how subject payment is going to work
- Add consent form to appear before instructions
The example study is set up to use Prolific. To submit it, run app.js
and make sure that your study is accessible from the web.
Then, figure out the URL with the URL parameters (eg. https://cogtoolslab.org:8881/dominoes/index.html?projName=BACH&expName=dominoes_OCP&iterName=it1
) and add this to a Prolific study.
Select "I'll use URL parameters" in the Prolific form, which will add additional URL parameters that tell us which participant is doing the study.
Prolific will suggest a completion code—this can be added into setup.js:504
to automatically accept participants who have finished it in Prolific.
Issue #62 aims to make this process easier.
Then simply open the Prolific study and watch the responses roll in.
You can navigate to OCP_local
to locally run the experiment by clicking on index.html
. The data is not stored, and the input is hardcoded—this is merely meant to be a quick way to see what the experiment looks like.