In Mechanical Turk, how do you limit to one HIT per worker

David Rand picture David Rand · May 14, 2010 · Viewed 13.6k times · Source

I know from communication with Mechanical Turk workers that there is a way to limit the number of HITs a specific worker can complete, but I cant figure out how to do it. Any help would be greatly appreciated!

Answer

Myle Ott picture Myle Ott · Dec 13, 2012

I've developed a script that mostly solves this problem. The main idea is to check the worker ID against a database and then hide the HIT if the worker has already completed a related HIT.

So that you don't need to host your own database server, I've made my script available as a (free) service at: http://uniqueturker.myleott.com. Please let me know if you have any trouble using the script, or if you have any questions or suggestions.

I'm also including the script here, in case you wish to use it with your own URL/database. If you go that route, you'll need to set up a web interface to your DB that takes a worker ID and returns "1" if the worker is allowed to work on the HIT and "0" otherwise. Then you'll just replace "YOUR_URL" below to point to that web interface:

<script type="text/javascript">
 (function() {
  var assignmentId = turkGetParam('assignmentId', '');
  if (assignmentId != '' && assignmentId != 'ASSIGNMENT_ID_NOT_AVAILABLE') {
   var workerId = turkGetParam('workerId', '');
   var url = 'http://YOUR_URL/?workerId='+workerId;
   var request = new XMLHttpRequest();
   request.open('GET', url, false);
   request.send();
   if (request.responseText != '1') {
    document.getElementById('mturk_form').style.display = 'none';
    document.getElementsByTagName('body')[0].innerHTML = "You have already completed the maximum number of HITs allowed by this requester. Please click 'Return HIT' to avoid any impact on your approval rating.";
   }
  }
 })();
</script>