Skip to content

A Guide for Creating Web pages for CrowdComputer

Pavel Kucherbaev edited this page Jul 25, 2013 · 18 revisions

Intro

CrowdComputer supports machine and human tasks. Human tasks should have a web-page, where a worker can do his/her job. These human tasks can be published on its internal crowdcomputer marketplace and on Amazon Mechanical TURK.

In this guide we will learn, how to create web pages for human tasks.


Guide

In this guide we consider an example of creation a survey page, where we want to get a feedback of people using some product "X".

  1. Go to one of your lovely IDE and create an index.html file, put the next content there:
<html>
   <body>
   </body>
</html>

2. In the body tag create a form for collecting a required information. ```

Feedback collection form

<textarea name='customer_feedback'/></textarea> ```

Now we have a form which does not store the information anywhere. Below we show how to connect this form with CrowdComputer and send data to MTURK.
3. Add a jQuery library and a JavaScript, provided by the CrowdComputer, in the end of the </body> tag:

<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="http://static.crowdcomputer.org/CC-JS-Generator/?type=send_all_to_mturk&tunnel=tunnel.php"></script>

There are two additional parameters:

  1. type states that we not want to have just a library of JavaScript functions, but also on form submit - send all the data to MTURK.
  2. tunnel states the path to the php file, via which we send data to CrowdComputer (if you do not define this parameter, by default it is tunnel.php).

The final content of the index.html file is:

<html>
   <body>
      <form>
         <h1>Feedback collection form</h1>
         <input type='text' name='customer_name'/>
         <textarea name='customer_feedback'/></textarea>
         <input type='submit' value='save form'>
      </form>
      <script src="http://code.jquery.com/jquery-latest.min.js"></script>
      <script src="http://static.crowdcomputer.org/CC-JS-Generator/?type=send_all_to_mturk&tunnel=tunnel.php"></script>
   </body>
</html>

We are done with our webpage, but now we need to create the tunnel.php file. Copy it from this github repository, or create an empty php file and put this content there.


Now we need to host our webpage. In order to do so - you need to have a shared hosting, which supports php. Usually you need to have an ftp access to upload files. For that you can use Filezilla Application.
You need to upload two files:

  1. index.html
  2. tunnel.php

Now when you create a task in the CrowdComputer in the field "task url" you can specify a url of your index.html page.