我是MTurk的新手,並一直試圖在此平臺上實現我的Web應用程序進行點選擇。我已經使用基於kaflurbaleen.blogspot的教程的ExternalQuestion成功創建了一個HIT。但是,當我測試沙箱中的代碼時,我意識到HIT並未按照需要工作。我發現如下兩個問題。使用MTurk的externalQuestion創建的HIT在沙箱中不起作用
我找不到應該追加到URL的'assignmentId'。我檢查了workersandbox,發現下面的網址接受任務 https://workersandbox.mturk.com/mturk/preview?groupId=3JCELWMC4P1FAXE0GMTAW1L96T93VS
據我瞭解,在「assignmentId」應該接受上面的鏈接後追加到URL之前。此參數必須使用'externalSubmit'方法返回到Mturk服務器。我發現只有下列參數後接受 hitId & prevHitSubmitted & prevRequester & requesterId & prevReward & hitAutoAppDelayInSeconds &的groupId &簽名
我也意識到可以根據需要在iframe的應用程序不能正常工作。每個(鼠標點擊+移動)應該創建一個紅色的球體,如原始網站https://s3.amazonaws.com/www.pickvertex3js.com/vertexpicking.html所示。
我曾嘗試谷歌尋找答案,很少成功。我現在正以智慧結束這兩個支撐我研究的問題。任何幫助將非常感激。使用BOTO3創建HIT的代碼如下。
import boto.mturk.connection
# define the host environment
sandbox_host = 'mechanicalturk.sandbox.amazonaws.com'
real_host = 'mechanicalturk.amazonaws.com'
mturk = boto.mturk.connection.MTurkConnection(
host = sandbox_host,
debug = 1
)
# test the setup of boto by printing the version and account balance
print(boto.Version)
print(mturk.get_account_balance())
# link to my web app, which will be loaded by the iframe of Mturk
URL = "https://s3.amazonaws.com/www.pickvertex3js.com/vertexpicking.html"
# setting task description of the iframe
title = "A Special HIT for Picking!"
description = "Vertex picking!"
keywords = ["3D mesh", "vertices"]
frame_height = 500 # the height of the iframe holding the external hit
amount = .00
# creating the HIT (task)
questionform = boto.mturk.question.ExternalQuestion(URL, frame_height)
response = mturk.create_hit(
title = title,
description = description,
keywords = keywords,
question = questionform,
reward = boto.mturk.price.Price(amount = amount),
response_groups = ('Minimal', 'HITDetail'),
)
# trying to get some outputs
HIT = response[0]
assert response.status
print ('[create_hit(%s, $%s): %s]' % (URL, amount, HIT.HITId))
# The response included several fields that will be helpful later
print ('Your HIT has been created. You can see it at this link:')
print ('https://workersandbox.mturk.com/mturk/preview?groupId={}'.format(HIT.HITTypeId))
print ('Your HIT ID is: {}'.format(HIT.HITId))