我正在使用我的Rails应用程序中的Turkee(https://github.com/aantix/turkee)gem来与Mechanical Turk进行交互。我正在创建一个像这样的HIT:
h = RTurk::Hit.create(:title => name || DEFAULT_TITLE) do |hit|
hit.assignments = size
hit.description = DEFAULT_DESCRIPTION
hit.reward = DEFAULT_REWARD
hit.lifetime = DEFAULT_DURATION
hit.question(survey_url, :frame_height => 1000)
end
Turkee::TurkeeTask.create(:sandbox => RTurk.sandbox?,
:hit_title => (name || DEFAULT_TITLE),
:hit_description => DEFAULT_DESCRIPTION,
:hit_reward => DEFAULT_REWARD.to_f,
:hit_num_assignments => size.to_i,
:hit_lifetime => (DEFAULT_DURATION.seconds/1.day).to_i,
:form_url => survey_url,
:hit_url => h.url,
:hit_id => h.id,
:task_type => '',
:batch_id => id,
:complete => false)
一切正常,但我想添加一个资格,以确保执行任务的任何人都来自美国。我查看了文档,我知道这是可能的,但我无法确定如何实现它。有没有人有什么建议?
提前致谢:)
答案 0 :(得分:2)
您需要添加国家/地区资格。你可以改变你的命中创建代码(见最后一行)
h = RTurk::Hit.create(:title => name || DEFAULT_TITLE) do |hit|
hit.assignments = size
hit.description = DEFAULT_DESCRIPTION
hit.reward = DEFAULT_REWARD
hit.lifetime = DEFAULT_DURATION
hit.question(survey_url, :frame_height => 1000)
hit.qualifications.country :eql => ['US']
end