Git Product home page Git Product logo

paxtonfitzpatrick / psiturk-experiment-template Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 9.0 40.98 MB

A template behavioral experiment ready to be deployed locally or on MTurk. Runs psiTurk, nginx, MySQL, & Adminer in networked docker containers. Includes slides from the accompanying tutorial.

Dockerfile 0.23% Python 2.45% CSS 12.45% JavaScript 74.86% HTML 10.01%
psiturk mturk docker nginx

psiturk-experiment-template's Introduction

psiturk-experiment-template

A template behavioral experiment ready to be run locally or deployed on Amazon Mechanical Turk. Slides from the accompanying tutorial are in slides/.

Commands

Starting the experiment server

  1. Start the Docker containers:

    $ docker-compose up -d
    Creating network "psiturk-experiment-template_default" with the default driver
    Creating my-experiment-adminer ... done
    Creating my-experiment-nginx   ... done
    Creating my-experiment         ... done
    Creating my-experiment-db      ... done

    When run for the first time, Docker will build the psiTurk image from Dockerfile and pull the others from Docker Hub.

  2. Attach standard input, output, and error to the psiTurk container:

    $ docker attach my-experiment
    root@dfeef3fee90e:/exp#

    If your shell prompt begins with root@, you're now inside the psiTurk container

  3. Launch the psiTurk shell:

    root@dfeef3fee90e:/exp# psiturk
    
    https://psiturk.org
     ______   ______     __     ______   __  __     ______     __  __
    /\  == \ /\  ___\   /\ \   /\__  _\ /\ \/\ \   /\  == \   /\ \/ /
    \ \  _-/ \ \___  \  \ \ \  \/_/\ \/ \ \ \_\ \  \ \  __<   \ \  _"-.
     \ \_\    \/\_____\  \ \_\    \ \_\  \ \_____\  \ \_\ \_\  \ \_\ \_\
      \/_/     \/_____/   \/_/     \/_/   \/_____/   \/_/ /_/   \/_/\/_/
    
                 an open platform for science on Amazon Mechanical Turk
    
    --------------------------------------------------------------------
    
    Due to a recent Amazon API deprecation, you need to install psiturk version 2.3.0 or later.
    
    v2.3.0 is python2 only, while versions of v2.3.x >= v2.3.1 support both python2 and python3.
    
    Check https://github.com/NYUCCL/psiTurk or https://psiturk.org for more info.
    psiTurk version 2.3.8
    Type "help" for more information.
    
  4. Switch the server on:

    [psiTurk server:off mode:sdbx #HITs:0]$ server on
    Experiment server launching...
    Now serving on http://0.0.0.0:22362
    

Running your experiment locally

With the experiment server on, run:

[psiTurk server:on mode:sdbx #HITs:0]$ debug
Launching browser pointed at your randomized debug link, feel free to request another.
	http://127.0.0.1:80/ad?assignmentId=debugXXXXXX&hitId=debugXXXXXX&workerId=debugXXXXXX&mode=debug

Note that the browser will not launch automatically because the server is running inside the Docker container. Copy/paste the generated link into a browser.

Testing your experiment in the MTurk sandbox

First, ensure that you're running in sandbox mode (the shell prompt should read "mode:sdbx"). With the experiment server on, run:

[psiTurk server:on mode:sdbx #HITs:0]$ hit create 1 0.01 1
*****************************
    Max workers: 1
    Reward: $0.01
    Duration: 1.0 hours
    Fee: $0.00
    ________________________
    Total: $0.01
Create sandbox HIT [y/n]? y
*****************************
  Created sandbox HIT
    HITid: 3BFF0DJK8YIPHERZLJFXL1DWL23TS0
    Max workers: 1
    Reward: $0.01
    Duration: 1.0 hours
    Fee: $0.00
    ________________________
    Total: $0.01
  Ad URL: https://sandbox.ad.psiturk.org/view/SskxbA8SWCGw3opFDiWEAW?assignmentId=debug63PAWI&hitId=debugVR03DZ&workerId=debugIJ3Q5T
Note: This url cannot be used to run your full psiTurk experiment.  It is only for testing your ad.
  MTurk URL: https://workersandbox.mturk.com/projects?filters%5Bsearch_term%5D=Example+MTurk+experiment
Hint: In OSX, you can open a terminal link using cmd + click
Note: This sandboxed ad will expire from the server in 16 days.

to create 1 sandbox HIT paying $0.01 (in fake money), available for 1 hour. Copy/paste the generated MTurk URL into a browser to view your MTurk listing and test your HIT, or use the Ad URL to test your HIT's advertisement. Note: the hit create command can also be run interactively by passing no parameters.

Posting live HITs for your experiment

First, ensure that you're running in live mode (the shell prompt should read "mode:live"). If you're running in sandbox (sdbx) mode, enter mode live and confirm when prompted to restart the server and switch to live mode. Then, create your HIT(s) with the hit create command as in sandbox mode

Approving, rejecting, and bonusing workers

see the psiTurk docs page on worker commands for a full guide to managing completed HITs

Resources

Relevant documentation

psiturk-experiment-template's People

Contributors

paxtonfitzpatrick avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.