2015-02-13 4 views
0

У меня есть следующий текущий код для создания выбора ответа:MTurk Ответ с форматированный текст

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> 

Как бы я конвертировать answer_options в форматированный текст с Бото?

ответ

1

Вот как вы можете настроить любую часть вашего метода 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 
Смежные вопросы