2017-07-07 51 views
0

我是MTurk的新手,并一直试图在此平台上实现我的Web应用程序进行点选择。我已经使用基于kaflurbaleen.blogspot的教程的ExternalQuestion成功创建了一个HIT。但是,当我测试沙箱中的代码时,我意识到HIT并未按照需要工作。我发现如下两个问题。使用MTurk的externalQuestion创建的HIT在沙箱中不起作用

  1. 我找不到应该追加到URL的'assignmentId'。我检查了workersandbox,发现下面的网址接受任务 https://workersandbox.mturk.com/mturk/preview?groupId=3JCELWMC4P1FAXE0GMTAW1L96T93VS

    据我了解,在“assignmentId”应该接受上面的链接后追加到URL之前。此参数必须使用'externalSubmit'方法返回到Mturk服务器。我发现只有下列参数后接受 hitId & prevHitSubmitted & prevRequester & requesterId & prevReward & hitAutoAppDelayInSeconds &的groupId &签名

  2. 我也意识到可以根据需要在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)) 

回答

0

我也在AWS开发者论坛上发布了一个回复,但在这里也添加了它。

这里的帖子:https://forums.aws.amazon.com/thread.jspa?threadID=259228&tstart=0

下面是它的一个副本,其他人因此从受益:

我看看你的命中率,我想我会在这里提供一些建议。首先,几个基准事情,如果他们帮助:

1)assignmentId被正确添加到您的HITs。您可以通过加载您共享的页面(https://workersandbox.mturk.com/mturk/preview?groupId=3JCELWMC4P1FAXE0GMTAW1L96T93VS),点击查看源代码并滚动到标签来确认。你应该看到的东西,看起来像这样:

<iframe height="500" scrolling="auto" frameborder="0" align="center" src="https://s3.amazonaws.com/www.pickvertex3js.com/vertexpicking.html?assignmentId=ASSIGNMENT_ID_NOT_AVAILABLE&amp;hitId=33K3E8REWX0SAJQPACFE1K5LTDBX8G" name="ExternalQuestionIFrame"></iframe> 

2)一旦你接受了HIT,你应该看到标签的变化看起来是这样的:

<iframe height="500" scrolling="auto" frameborder="0" align="center" src="https://s3.amazonaws.com/www.pickvertex3js.com/vertexpicking.html?assignmentId=38YMOXR4MW4S3P05XVRV37Q4QFGW6D&amp;hitId=33K3E8REWX0SAJQPACFE1K5LTDBX8G&amp;workerId=A39ECJ12CY7TE9&amp;turkSubmitTo=https%3A%2F%2Fworkersandbox.mturk.com" name="ExternalQuestionIFrame"></iframe> 

3)我在当时一看你的代码,并且我可以确认它在直接加载时工作正常,但放在IFRAME中似乎不起作用。我进一步尝试了解onDocumentMouseDown()方法是否在IFRAME(我在该函数中添加了alert())时被调用,并且它是。我最好的猜测是,没有深入研究它,是因为THREE库对IFRAME视口不友好。这也可能是这样的一条线:

var mouse3D = new THREE.Vector3((event.clientX/window.innerWidth) * 2 - 1, 
-(event.clientY/window.innerHeight) * 2 + 1, 
0.5); 

没有使用右窗口(即,,而不是使用IFRAME视口,它使用整个浏览器窗口,导致怪异/错误/错误行为)。

简短的说法是我不认为你的问题与MTurk本身有关,而是与IFRAME相关。作为一种不理想的解决方法,您也可以考虑将Worker直接链接到您的页面(而不是IFRAME)并将其链接回MTurk上的提交URL。这并不理想,但我认为它可以奏效。

希望有所帮助。