Skip to content
Κοῖος edited this page May 20, 2017 · 1 revision

System Requirements

LegionTools was built and tested on an Ubuntu 14.04.5 LTS Desktop 64bit with PHP 5.5.9.

Overview

The LegionTools basic HTML layout is in index.php which includes scripts from the Retainer/scripts folder, most notably trigger.js which connects GUI elements with the PHP backend in Retainer/php via AJAX calls. The databases (SQLite) for each user are contained in the db folder. The Overview folder is less important. It primarily contains an older MTurk PHP API in Overview/turk. All new functionality should use Amazon's new AWS SDK, which can be found in Retainer/php/lib/Aws. There are some mockup resources in extras including a Fake HIT and a Fake Tutorial Page that are useful for testing purposes. Finally, there is a preliminary REST API in Retainer/api.

API

While the API has stubs for all basic REST calls (GET, UPDATE, DELETE), the current functionality uses POST exclusively, since input data is needed. For retainer mode which keeps a pool of users to route to tasks there are 3 basic steps: Preparation, call and query_available, the former two of which are executed in two steps. Retainer/api/client.php outlines the steps to use Retainer mode. Please note that Retainer mode relies on a fully HTTPS secured server setup.

Extras

The extras directory contains bookmarklets and mockup pages for testing during development. The bookmarklets can be found in Bookmarklets.html. You can fill in your keys and URLs into the placeholders and then login, create tasks, select existing experiments or create a new one with single clicks. The Fake HIT can be used as a mockup HIT that can be completed by simply pressing a button. It also sends a bonus suggestion with its result to test bonusing. The Fake Tutorial is an analogous placeholder to test Retainer mode.

Docker Container

The main directory contains a basic Dockerfile. You can use it to build a Docker image via docker build -t legion . that can then be run via docker run -d -p 2345:80 legion /usr/sbin/apache2ctl -D FOREGROUND. You can then open http://localhost:2345/legion/ and start using LegionTools. Please be aware that while the Dockerfile will generate self-signed 4096bit RSA certificates to properly develop for Retainer mode it is very helpful to have a proper server setup with an official certificate signed by a proper certification authority.

Clone this wiki locally