Reputation: 149
I am trying to implement an external question in Amazon Mechanical Turk. Everything is working fine except for the submit
input which keeps returning the following error:
There was a problem submitting your results for this HIT.
This HIT is still assigned to you. To try this HIT again, click "HITs Assigned To You" in the navigation bar, then click "Continue work on this HIT" for the HIT. If this problem persists, you can contact the Requester for this HIT using the "Contact" link above.
To return this HIT and continue working on other HITs, click the "Return HIT" button.
I have tried everything I can to make the submit task button work and have checked every post I could find on Google and on this website but nothing works.
This is the code for the submit button on my website:
<form name="hitForm" id="hitForm" action="https://workersandbox.mturk.com/mturk/externalSubmit" method="POST">
<input type="hidden" name="assignmentId" value="<?php echo $_REQUEST["assignmentId"]; ?>" />
<input type="hidden" name="hitId" value="<?php echo $_REQUEST["hitId"]; ?>" />
<input type="hidden" name="workerId" value="<?php echo $_REQUEST["workerId"]; ?>" />
<input type="submit" class="btn btn-primary btn-lg active" role="button">
</form>
The user needs to click the submit button on the form once they are done with the task to submit the HIT and receive their payment. I have tried sending the form with more and with less information, I have tried hard coding the information (of the user currently testing the HIT) to the form, I have tried using a hyperlink with the user data, and I have tried submitting the task from different users, from different computers, from different networks, and so on.
Any assistance on this error will be greatly appreciated.
Edit:
I have tried what Thomas has said but I still get the same error message. My form now looks like this:
<form name="hitForm" id="hitForm" action="https://workersandbox.mturk.com/mturk/externalSubmit" method="POST">
<input type="hidden" name="assignmentId" value="<?php echo $_COOKIE["PlayerUserName"]; ?>" />
<input type="hidden" name="foo" value="" />
<input type="submit" class="btn btn-primary btn-lg active" role="button">
</form>
And yes, I am working on the requester sandbox to make sure my entire HIT works properly before opening it to the regular Mechanical Turk.
Upvotes: 4
Views: 1157
Reputation: 1110
For anyone still facing problems, this is what worked for me:
In my external HTML file, I include the following line which contains the function turkSetAssignmentID
:
<script src="https://s3.amazonaws.com/mturk-public/externalHIT_v1.js"></script>
And I called a function in the head of my HTML as follows:
<head>
<script language='Javascript'>
window.onload = function() {
turkSetAssignmentID();
};
</script>
</head>
And then I put my entire HTML body content inside a form
tag:
<form id="mturk_form" method="POST">
<input id="assignmentId" name="assignmentId" type="hidden"></input>
<input id="answer_spans" name="answer_spans" type="hidden"></input>
<!-- Rest of the HTML contents go here -->
</form>
And then everything worked perfect for me.
Note that you don't even need to worry whether you are in sandbox or prod. The turkSetAssignmentID
function takes care of everything by checking your URL. Note that the by default expects the id of your form to be "mturk_form"
and the id of your button to be "submitButton"
.
Upvotes: 0
Reputation: 44527
A couple of possibilities:
workersandbox
with www
for the live server.hitId
or workerId
back to the submit URL. These are ignored by MTurk, so there's no point in trying to send them.assignmentId
, otherwise the submission will fail. A hidden "foo"
field, for example, would be sufficient.Upvotes: 2