0

I have the following current code to create an answer selection:

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)

For example:

# 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>

How would I convert the answer_options into formatted text with boto?

David542
  • 104,438
  • 178
  • 489
  • 842

1 Answers1

0

Here is how you can customize any part of your CreateQualificationType method:

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
David542
  • 104,438
  • 178
  • 489
  • 842