###How do I run an experiment? You'll still need to follow all of the instructions for using PsiTurk.
But this is what the workflow will look like in your terminal:
-
Install PsiTurk and the Python component of Speriment. This only has to be done once, whereas future steps are done once per experiment. Another one-time installation you may want to consider is of a database like MySQL, as the database PsiTurk uses by default may lead to corrupt data if multiple participants try to submit data at once. See the PsiTurk documentation.
sudo pip install psiturk
sudo pip install speriment
-
Make a project directory for this experiment. In this case I'm calling it
myproject
.psiturk-setup-example
mv psiturk-example/ myproject/
-
Edit your configuration files and the following files in
templates
:Note that exp.html is required for PsiTurk, but you should not edit it, because Speriment does so automatically. Speriment also automatically edits
static/task.js
, so do not delete it. -
Write a Python script to generate a Speriment from a csv of your experimental materials. Put the csv file and the Python script in
myproject
(or whatever you called the directory). -
Install the JavaScript component of Speriment.
cd ~/myproject/static/lib
npm install speriment
-
Run your Python script. It's important to do this after installing Speriment. If you accidentally do it in the wrong order, you can always rerun the script.
cd ~/myproject
python myscript
-
Enter the PsiTurk shell. If you're using a MySQL database, start its server first with
mysql.server start
.psiturk
-
In the PsiTurk shell, turn on the server and, if you're using a tunnel, open a tunnel.
server on
tunnel open
-
Debug your experiment in your browser.
debug
-
Try out your experiment in the Mechanical Turk Sandbox. This command will ask you questions and then give you two links; follow the Sandbox link.
hit create
-
When you're ready, switch to live mode and make a HIT to put on the real Mechanical Turk.
mode
hit create
The PsiTurk shell also has other useful commands, so check out its documentation.
-
Check on your experiment as it's running with PsiTurk commands like
hit list
andworker list.
When the HIT is reviewable, you can runworker approve
to pay workers. -
Finally, use Speriment to retrieve and format your data, writing it to a csv in your project directory that you can load into Python or R. Speriment comes with a command-line tool
speriment-output
to make this easy. It takes one required argument and one optional list of arguments. The required argument is the name of a file to write the results to. The optional one is --exclude or -e. It should be used if you know already that you want to exclude data from certain workers. You can exclude them after looking at the data, so this is just a convenience. Follow the flag with the worker IDs of the workers you want to exclude.Here, I'm imagining I want to exclude the data that I generated when I was debugging the experiment and was given worker ID debugALHLUO.
speriment-output myproject_results.csv -e debugALHLUO