抓取HIT中每次击键的时间戳

时间:2015-11-14 05:28:22

标签: amazon-web-services boto mechanicalturk boto3

我正在创建一个显示图像和文本框的HIT。我想在列表或其他数据结构中记录文本字段中每个按键的时间戳,并在查看HIT响应时获取该信息。目前,我正在使用boto编写HIT。

这是我目前的代码:

from boto.mturk.connection import MTurkConnection
from boto.mturk.question import (QuestionContent,Question,QuestionForm, Overview,AnswerSpecification,SelectionAnswer,FormattedContent,FreeTextAnswer)

ACCESS_ID ='****************'
SECRET_KEY = '******************'
HOST = 'mechanicalturk.sandbox.amazonaws.com'

mtc = MTurkConnection(aws_access_key_id=ACCESS_ID,
                  aws_secret_access_key=SECRET_KEY,
                  host=HOST)

title = 'Give your feelings about a picture'
description = ('View a picture and give us your opinion on the image.')
keywords = 'image, comments, opinions'

#---------------  BUILD OVERVIEW -------------------

overview = Overview()
overview.append_field('Title', 'Type what you think about this picture!')
overview.append(FormattedContent('<img src="http://globe-views.com/dcim/dreams/mountain/mountain-03.jpg" '
                                 ' alt="Mountain" '
                                 ' height="40" '
                                 ' width="40"/>'))


#---------------  BUILD QUESTION 1 -------------------

qc2 = QuestionContent()
qc2.append_field('Title','Your Comments')

fta2 = FreeTextAnswer()

q2 = Question(identifier="comments",
              content=qc2,
              answer_spec=AnswerSpecification(fta2))

#--------------- BUILD THE QUESTION FORM -------------------

question_form = QuestionForm()
question_form.append(overview)
question_form.append(q2)

#--------------- CREATE THE HIT -------------------

mtc.create_hit(questions=question_form,
               max_assignments=1,
               title=title,
               description=description,
               keywords=keywords,
               duration = 60,
               reward=0.05)

我真的不知道从哪里开始,因为我只知道如何使用jQuery记录按键时间戳。我之前没有使用Mechanical Turk API的经验,到目前为止我写的所有内容都是基于教程。任何帮助,将不胜感激。谢谢!

0 个答案:

没有答案