带有格式化文本的 MTurk 答案

MTurk Answer with formatted text

我有以下当前代码来创建答案选择:

q1_answer_options=[('No URL exists', 0), ('http://www.imdb.com/name/nm2271332/', 1), ('http://www.imdb.com/title/tt0460987/', 2), ('http://www.imdb.com/title/tt1450653/', 3),  ('http://www.imdb.com/title/tt1438289/', 4)]
fta1 = SelectionAnswer(style='radiobutton', selections=q1_answer_options)

例如:

# Currently is this
<Selection>
  <SelectionIdentifier>0</SelectionIdentifier>
  <Text>No URL Exists</Text>
</Selection>

# I want it to be this
<Selection>
  <SelectionIdentifier>0</SelectionIdentifier>
  <FormattedContent><![CDATA[No URL Exists]]></FormattedContent>
</Selection>

如何使用 boto 将 answer_options 转换为格式化文本?

以下是自定义 CreateQualificationType 方法的任何部分的方法:

conn = MTurkConnection(self.aws_access_key, self.aws_secret_key, host=self.host)

params = dict()
params['Operation'] = 'CreateQualificationType'
params['QualificationTypeStatus'] = 'Active'
params['Name'] = name
params['TestDurationInSeconds'] = test_duration
params['RetryDelayInSeconds'] = retry_delay
params['Keywords'] = keywords
params['Description'] = description
params['Test'] = test_as_xml
params['AnswerKey'] = answer_key_as_xml


response = m.conn.make_request(action=None, params=params, path='/', verb='POST)
m.conn._process_response(response) # this is the response and will tell if if there are any errors