How do I define what the “submit” button returns on Mechanical Turk?

回眸只為那壹抹淺笑 提交于 2019-12-11 07:05:04

问题


I'm writing my own HIT template for mTurk with HTML / JavaScript (editing the source section). MTurk's format for workers' response is an excel file with various parameters (such as assignment ID, worker ID, etc.). I'm having trouble finding out how do modify this returned excel file, in order to include my own custom parameters in it.

To simplify, my code is:

<html>
      <script type="text/javascript">
           //many functions
           var myObject = {};
           //event listeners add attributes to myObject
      </script>
</html>

The answer to my HIT is the content of myObject, so I need to link it to the submit button and add it to the outputted excel file.


回答1:


When using HTMLQuestion, your template is the one creating the submit button. When the submit button is clicked, you need to cause that to POST the contents of myObject to the external submit endpoint (e.g. https://www.mturk.com/mturk/externalSubmit). To do that, you could follow a recipe like this: POST data in JSON format



来源:https://stackoverflow.com/questions/51246928/how-do-i-define-what-the-submit-button-returns-on-mechanical-turk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!