我是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))