Reputation: 163
I want to create an mturk HIT that has a URL like so:
www.example.com?source=worker_id
where worker_id is the worker's ID code. I'm initially going to create these from the mturk web UI, then once I get it working right, from PHP. But I can't figure out how to get at the worker's ID from the modified-HTML syntax of an mturk HIT.
Upvotes: 7
Views: 3582
Reputation: 3426
Note that the workerId is NOT sent during the preview, only after the HIT has been accepted. If you're using an External HIT, you can create a cookie to see if it's a worker who has accepted a previous hit, but of course that method is unreliable.
Upvotes: 2
Reputation: 3038
Mechanical Turk will call your website with a URL that looks like:
www.example.com/?hitId=2384239&assignmentId=ASD98ASDFADJKH&workerId=ASDFASD8
In your php page that is at that location you can access the workerId (as well as the other Ids) like so:
<?php
$hitId = $_REQUEST["hitId"];
$assignmentId = $_REQUEST["assignmentId"];
$workerId = $_REQUEST["workerId"];
echo "Hit ID: $hitId\n";
echo "Ass ID: $assignmentId\n";
echo "Worker ID: $workerId\n";
?>
Upvotes: 11