【问题标题】:HITs created using externalQuestion of MTurk were not working in the sandbox使用 MTurk 的 externalQuestion 创建的 HIT 在沙箱中不起作用
【发布时间】:2017-07-07 03:19:54
【问题描述】:

我是 MTurk 的新手,我一直在尝试在这个平台上实现我的网络应用程序以进行点选。我已经根据 kaflurbaleen.blogspot 的教程使用 ExternalQuestion 成功创建了一个 HIT。但是,当我在沙箱中测试代码时,我意识到 HIT 没有按预期工作。我发现了以下两个问题。

  1. 我找不到应该附加到 URL 的“assignmentId”。在接受任务之前检查了workersandbox,发现如下网址 https://workersandbox.mturk.com/mturk/preview?groupId=3JCELWMC4P1FAXE0GMTAW1L96T93VS

    据我了解,在接受上述链接后,应将“assignmentId”附加到 URL。并且这个参数必须使用 'externalSubmit' 方法返回给 Mturk 服务器。验收后发现只有以下参数 hitId&prevHitSubmitted&prevRequester&requesterId&prevReward&hitAutoAppDelayInSeconds&groupId&signature

  2. 我还意识到该应用程序在 iframe 中无法正常运行。每个(鼠标单击 + shift)都应该创建一个红色球体,如原始网站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))

【问题讨论】:

    标签: python amazon boto3 mechanicalturk


    【解决方案1】:

    我也在 AWS 开发人员论坛上发布了回复,但也将其添加到此处。

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

    这是它的副本,供 SO 上的其他人从中受益:

    我查看了您的 HIT,并想在这里提供一些建议。首先,一些基本的东西,以防万一他们有帮助:

    1) assignmentId 已正确添加到您的 HIT 中。您可以通过加载您共享的页面 (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 时似乎无法正常工作。我更进一步尝试确定在 IFRAME 中显示时是否甚至调用了 onDocumentMouseDown() 方法(我在该函数中添加了一个 alert() )并且确实如此。我最好的猜测是,在没有深入研究的情况下,The 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。这并不理想,但我认为它可以工作。

    希望对您有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多