rturk 2.0.2 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.markdown +3 -2
- data/Rakefile +10 -4
- data/VERSION +1 -1
- data/aws_docs/ApiReference_AnswerKeyDataStructureArticle.html +98 -0
- data/aws_docs/ApiReference_ApproveAssignmentOperation.html +75 -0
- data/aws_docs/ApiReference_AssignQualificationOperation.html +107 -0
- data/aws_docs/ApiReference_AssignmentDataStructureArticle.html +171 -0
- data/aws_docs/ApiReference_BlockWorkerOperation.html +70 -0
- data/aws_docs/ApiReference_ChangeHITTypeOfHITOperation.html +68 -0
- data/aws_docs/ApiReference_CommonParametersArticle.html +119 -0
- data/aws_docs/ApiReference_CreateHITOperation.html +330 -0
- data/aws_docs/ApiReference_CreateQualificationTypeOperation.html +190 -0
- data/aws_docs/ApiReference_DataStructuresArticle.html +7 -0
- data/aws_docs/ApiReference_DisableHITOperation.html +63 -0
- data/aws_docs/ApiReference_DisposeHITOperation.html +56 -0
- data/aws_docs/ApiReference_DisposeQualificationTypeOperation.html +52 -0
- data/aws_docs/ApiReference_ExtendHITOperation.html +86 -0
- data/aws_docs/ApiReference_ExternalQuestionArticle.html +125 -0
- data/aws_docs/ApiReference_ForceExpireHITOperation.html +61 -0
- data/aws_docs/ApiReference_FormattedContentXHTMLArticle.html +289 -0
- data/aws_docs/ApiReference_GetAccountBalanceOperation.html +51 -0
- data/aws_docs/ApiReference_GetAssignmentsForHITOperation.html +166 -0
- data/aws_docs/ApiReference_GetBonusPaymentsOperation.html +160 -0
- data/aws_docs/ApiReference_GetFileUploadURLOperation.html +75 -0
- data/aws_docs/ApiReference_GetHITOperation.html +89 -0
- data/aws_docs/ApiReference_GetHITsForQualificationTypeOperation.html +137 -0
- data/aws_docs/ApiReference_GetQualificationRequestsOperation.html +155 -0
- data/aws_docs/ApiReference_GetQualificationScoreOperation.html +68 -0
- data/aws_docs/ApiReference_GetQualificationTypeOperation.html +57 -0
- data/aws_docs/ApiReference_GetQualificationsForQualificationTypeOperation.html +134 -0
- data/aws_docs/ApiReference_GetRequesterStatisticOperation.html +315 -0
- data/aws_docs/ApiReference_GetReviewableHITsOperation.html +155 -0
- data/aws_docs/ApiReference_GrantBonusOperation.html +95 -0
- data/aws_docs/ApiReference_GrantQualificationOperation.html +69 -0
- data/aws_docs/ApiReference_HITDataStructureArticle.html +302 -0
- data/aws_docs/ApiReference_HelpOperation.html +125 -0
- data/aws_docs/ApiReference_LocaleDataStructureArticle.html +29 -0
- data/aws_docs/ApiReference_NotificationAPI_BuildingANotificationReceptor.html +36 -0
- data/aws_docs/ApiReference_NotificationAPI_ElementsOfANotification.html +40 -0
- data/aws_docs/ApiReference_NotificationDataStructureArticle.html +73 -0
- data/aws_docs/ApiReference_NotificationReceptorAPIArticle.html +9 -0
- data/aws_docs/ApiReference_NotificationReceptorAPI_RESTTransportArticle.html +39 -0
- data/aws_docs/ApiReference_NotificationReceptorAPI_SOAPTransportArticle.html +45 -0
- data/aws_docs/ApiReference_NotifyWorkersOperation.html +82 -0
- data/aws_docs/ApiReference_OperationsArticle.html +8 -0
- data/aws_docs/ApiReference_PriceDataStructureArticle.html +65 -0
- data/aws_docs/ApiReference_QualificationDataStructureArticle.html +89 -0
- data/aws_docs/ApiReference_QualificationRequestDataStructureArticle.html +102 -0
- data/aws_docs/ApiReference_QualificationRequirementDataStructureArticle.html +176 -0
- data/aws_docs/ApiReference_QualificationTypeDataStructureArticle.html +198 -0
- data/aws_docs/ApiReference_QuestionAnswerDataArticle.html +8 -0
- data/aws_docs/ApiReference_QuestionFormAnswersDataStructureArticle.html +54 -0
- data/aws_docs/ApiReference_QuestionFormDataStructureArticle.html +796 -0
- data/aws_docs/ApiReference_RegisterHITTypeOperation.html +149 -0
- data/aws_docs/ApiReference_RejectAssignmentOperation.html +66 -0
- data/aws_docs/ApiReference_RejectQualificationRequestOperation.html +61 -0
- data/aws_docs/ApiReference_RevokeQualificationOperation.html +78 -0
- data/aws_docs/ApiReference_SearchHITsOperation.html +164 -0
- data/aws_docs/ApiReference_SearchQualificationTypesOperation.html +211 -0
- data/aws_docs/ApiReference_SendTestEventNotificationOperation.html +78 -0
- data/aws_docs/ApiReference_SetHITAsReviewingOperation.html +73 -0
- data/aws_docs/ApiReference_SetHITTypeNotificationOperation.html +99 -0
- data/aws_docs/ApiReference_UnblockWorkerOperation.html +67 -0
- data/aws_docs/ApiReference_UpdateQualificationScoreOperation.html +77 -0
- data/aws_docs/ApiReference_UpdateQualificationTypeOperation.html +180 -0
- data/aws_docs/ApiReference_WsdlLocationArticle.html +95 -0
- data/aws_docs/ApiReference_XMLParameterValuesArticle.html +37 -0
- data/aws_docs/Welcome.html +125 -0
- data/aws_docs/WhatsNew.html +16 -0
- data/aws_docs/_title.html +28 -0
- data/aws_docs/_toc.html +749 -0
- data/aws_docs/aws-docs-IE.css +419 -0
- data/aws_docs/aws-docs.css +455 -0
- data/aws_docs/copyrightinfo.html +14 -0
- data/aws_docs/frameset.js +12 -0
- data/aws_docs/images/Feedback_link.gif +0 -0
- data/aws_docs/images/caution.png +0 -0
- data/aws_docs/images/home.gif +0 -0
- data/aws_docs/images/important.png +0 -0
- data/aws_docs/images/next.gif +0 -0
- data/aws_docs/images/note.png +0 -0
- data/aws_docs/images/prev.gif +0 -0
- data/aws_docs/images/tip.png +0 -0
- data/aws_docs/images/title-swoosh-logo.gif +0 -0
- data/aws_docs/images/toc_bullet.gif +0 -0
- data/aws_docs/images/toc_plus.gif +0 -0
- data/aws_docs/index.html +18 -0
- data/aws_docs/toc.js +84 -0
- data/lib/rturk.rb +2 -2
- data/lib/rturk/adapter.rb +11 -0
- data/lib/rturk/adapters/assignment.rb +13 -50
- data/lib/rturk/adapters/hit.rb +21 -9
- data/lib/rturk/adapters/worker.rb +23 -0
- data/lib/rturk/operation.rb +1 -1
- data/lib/rturk/operations/create_hit.rb +10 -54
- data/lib/rturk/operations/register_hit_type.rb +68 -0
- data/lib/rturk/operations/search_hits.rb +44 -0
- data/lib/rturk/parser.rb +8 -0
- data/lib/rturk/parsers/answer_parser.rb +29 -0
- data/lib/rturk/parsers/assignment_parser.rb +49 -0
- data/lib/rturk/parsers/hit_parser.rb +50 -0
- data/lib/rturk/{response.rb → parsers/response.rb} +7 -2
- data/lib/rturk/{responses → parsers/responses}/create_hit_response.rb +2 -2
- data/lib/rturk/{responses → parsers/responses}/get_account_balance_response.rb +0 -0
- data/lib/rturk/{responses → parsers/responses}/get_assignments_for_hit_response.rb +3 -3
- data/lib/rturk/{responses → parsers/responses}/get_hit_response.rb +9 -16
- data/lib/rturk/{responses → parsers/responses}/get_reviewable_hits_response.rb +3 -5
- data/lib/rturk/parsers/responses/register_hit_type_response.rb +17 -0
- data/lib/rturk/parsers/responses/search_hits_response.rb +65 -0
- data/lib/rturk/xml_utilities.rb +14 -3
- data/rturk.gemspec +112 -12
- data/spec/adapters/hit_spec.rb +10 -0
- data/spec/fake_responses/register_hit_type.xml +6 -0
- data/spec/fake_responses/search_hits.xml +50 -0
- data/spec/operations/create_hit_spec.rb +2 -2
- data/spec/operations/get_hit_spec.rb +1 -1
- data/spec/operations/register_hit_type_spec.rb +24 -0
- data/spec/{adapters/answers_spec.rb → parsers/answer_parser_spec.rb} +2 -2
- data/spec/parsers/hit_parser_spec.rb +41 -0
- data/spec/xml_parse_spec.rb +2 -2
- metadata +111 -11
- data/lib/rturk/adapters/answers.rb +0 -38
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<html xmlns:fo="http://www.w3.org/1999/XSL/Format"><head>
|
|
2
|
+
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
|
3
|
+
<title>Chapter 7. Question and Answer Data</title><link rel="stylesheet" href="aws-docs-IE.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"><link rel="home" href="#top" title="Amazon Mechanical Turk"><link rel="up" href="#top" title="Amazon Mechanical Turk"><link rel="prev" href="ApiReference_NotificationDataStructureArticle.html" title="Notification"><link rel="next" href="ApiReference_XMLParameterValuesArticle.html" title="Using XML Parameter Values"><!--[if !IE]>--><link rel="stylesheet" href="aws-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"><!--<![endif]--><meta xmlns="http://www.w3.org/1999/xhtml" http-equiv="Content-Type" content="text/html; charset=utf-8"></meta><script src="/urchin.js" type="text/javascript"></script><script type="text/javascript">
|
|
4
|
+
urchinTracker();
|
|
5
|
+
</script><script xmlns="http://www.w3.org/1999/xhtml" type="text/javascript" src="frameset.js"> //
|
|
6
|
+
</script></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header" cellspacing="0" cellpadding="2"><tr><td width="30%" align="left"><a accesskey="p" href="ApiReference_NotificationDataStructureArticle.html"><img src="images/prev.gif" alt="Prev"></a> </td><td width="40%" align="center"><a href="http://survey.amazonwebservices.com/survey/s?s=559&opdata_page=Mturk_API_2008-08-02_ApiReference_QuestionAnswerDataArticle">Documentation Feedback</a></td><td width="30%" align="right"> <a accesskey="n" href="ApiReference_XMLParameterValuesArticle.html"><img src="images/next.gif" alt="Next"></a></td></tr></table><div class="breadcrumb"><a href="Welcome.html">Welcome</a><a href=""></a> » <strong>Question and Answer Data</strong></div></div><div class="chapter" lang="en" id="ApiReference_QuestionAnswerDataArticle"><div class="titlepage"><div><div><h1 class="topictitle">Question and Answer Data</h1></div></div></div><a class="indexterm" name="d0e16903"></a><a class="indexterm" name="d0e16906"></a><div class="highlights"><p><strong>Topics</strong></p><ul><li><a href="ApiReference_XMLParameterValuesArticle.html">Using XML Parameter Values</a></li><li><a href="ApiReference_QuestionFormDataStructureArticle.html">QuestionForm</a></li><li><a href="ApiReference_FormattedContentXHTMLArticle.html">Formatted Content: XHTML</a></li><li><a href="ApiReference_QuestionFormAnswersDataStructureArticle.html">QuestionFormAnswers</a></li><li><a href="ApiReference_AnswerKeyDataStructureArticle.html">AnswerKey</a></li><li><a href="ApiReference_ExternalQuestionArticle.html">ExternalQuestion</a></li></ul></div><p> The questions and answers that Amazon Mechanical Turk passes between Requesters and Workers are XML
|
|
7
|
+
documents that conform to schemas. These documents are passed to the service and returned by the
|
|
8
|
+
service as parameter values. </p></div><div class="navfooter"><table width="100%" summary="Navigation footer" cellspacing="0" cellpadding="2"><tr><td width="30%" align="left"><a accesskey="p" href="ApiReference_NotificationDataStructureArticle.html"><img src="images/prev.gif" alt="Prev"></a> </td><td width="40%" align="center"><a href="http://survey.amazonwebservices.com/survey/s?s=559&opdata_page=Mturk_API_2008-08-02_ApiReference_QuestionAnswerDataArticle">Documentation Feedback</a><br><a href="copyrightinfo.html">Copyright Information</a></td><td width="30%" align="right"> <a accesskey="n" href="ApiReference_XMLParameterValuesArticle.html"><img src="images/next.gif" alt="Next"></a></td></tr><tr><td width="30%" align="left" valign="top"> </td><td width="40%" align="center"><a accesskey="h" href="#top"><img src="images/home.gif" alt="Home"></a></td><td width="30%" align="right" valign="top"> </td></tr></table></div></body></html>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<html xmlns:fo="http://www.w3.org/1999/XSL/Format"><head>
|
|
2
|
+
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
|
3
|
+
<title>QuestionFormAnswers</title><link rel="stylesheet" href="aws-docs-IE.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"><link rel="home" href="#top" title="Amazon Mechanical Turk"><link rel="up" href="ApiReference_QuestionAnswerDataArticle.html" title="Chapter 7. Question and Answer Data"><link rel="prev" href="ApiReference_FormattedContentXHTMLArticle.html" title="Formatted Content: XHTML"><link rel="next" href="ApiReference_AnswerKeyDataStructureArticle.html" title="AnswerKey"><!--[if !IE]>--><link rel="stylesheet" href="aws-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"><!--<![endif]--><meta xmlns="http://www.w3.org/1999/xhtml" http-equiv="Content-Type" content="text/html; charset=utf-8"></meta><script src="/urchin.js" type="text/javascript"></script><script type="text/javascript">
|
|
4
|
+
urchinTracker();
|
|
5
|
+
</script><script xmlns="http://www.w3.org/1999/xhtml" type="text/javascript" src="frameset.js"> //
|
|
6
|
+
</script></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header" cellspacing="0" cellpadding="2"><tr><td width="30%" align="left"><a accesskey="p" href="ApiReference_FormattedContentXHTMLArticle.html"><img src="images/prev.gif" alt="Prev"></a> </td><td width="40%" align="center"><a href="http://survey.amazonwebservices.com/survey/s?s=559&opdata_page=Mturk_API_2008-08-02_ApiReference_QuestionFormAnswersDataStructureArticle">Documentation Feedback</a></td><td width="30%" align="right"> <a accesskey="n" href="ApiReference_AnswerKeyDataStructureArticle.html"><img src="images/next.gif" alt="Next"></a></td></tr></table><div class="breadcrumb"><a href="Welcome.html">Welcome</a><a href=""></a> » <a href="ApiReference_QuestionAnswerDataArticle.html">Question and Answer Data</a> » <strong>QuestionFormAnswers</strong></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h1 class="topictitle">QuestionFormAnswers</h1></div></div></div><a class="indexterm" name="d0e19762"></a><a class="indexterm" name="d0e19765"></a><a class="indexterm" name="d0e19770"></a><a class="indexterm" name="d0e19775"></a><a class="indexterm" name="d0e19780"></a><div class="highlights"><p><strong>Topics</strong></p><ul><li><a href="ApiReference_QuestionFormAnswersDataStructureArticle.html#d0e19788">Description</a></li><li><a href="ApiReference_QuestionFormAnswersDataStructureArticle.html#d0e19853">The Structure of Answers</a></li><li><a href="ApiReference_QuestionFormAnswersDataStructureArticle.html#d0e19940">Example</a></li></ul></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both" id="d0e19788">Description</h2></div></div></div><p> The <em class="parameter"><code>QuestionFormAnswers</code></em> data format describes answers submitted by a
|
|
7
|
+
Worker for a HIT, or for a Qualification test. </p><p> A <em class="parameter"><code>QuestionFormAnswers</code></em> data structure is a string value that consists of
|
|
8
|
+
XML data. The XML data must conform to the QuestionForm schema. See <a class="link" href="ApiReference_WsdlLocationArticle.html" title="Chapter 3. WSDL and Schema Locations">WSDL and Schema Locations</a> for the location
|
|
9
|
+
of this schema. For more information about using XML data as parameter or return value, see <a class="link" href="ApiReference_XMLParameterValuesArticle.html" title="Using XML Parameter Values">Using XML Parameter Values</a>. </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p> Answer data is <span class="emphasis"><em>not</em></span> guaranteed by the Amazon Mechanical Turk Service to
|
|
10
|
+
conform to the answer specifications described in a QuestionForm. MTS only guarantees that
|
|
11
|
+
answer data returned by the service will conform to the
|
|
12
|
+
<em class="parameter"><code>QuestionFormAnswers</code></em> schema. Your application should check that the
|
|
13
|
+
answer data sufficiently answers the question. </p></td></tr></table></div><p> The <em class="parameter"><code>QuestionFormAnswers</code></em> data structure is used as a response element for
|
|
14
|
+
the following operations: </p><div class="itemizedlist"><ul type="disc"><li><p>
|
|
15
|
+
<code class="function">GetAssignmentsForHIT</code>
|
|
16
|
+
</p></li><li><p>
|
|
17
|
+
<code class="function">GetQualificationRequests</code>
|
|
18
|
+
</p></li></ul></div><p> The <em class="parameter"><code>QuestionFormAnswers</code></em> data structure is a value in an <a class="link" href="ApiReference_AssignmentDataStructureArticle.html" title="Assignment">Assignment data structure</a>, and a
|
|
19
|
+
value in a <a class="link" href="ApiReference_QualificationRequestDataStructureArticle.html" title="QualificationRequest">QualificationRequest data structure</a>. </p><p> All elements in a <em class="parameter"><code>QuestionFormAnswers</code></em> belong to a namespace whose name
|
|
20
|
+
is identical to the URL of the <em class="parameter"><code>QuestionFormAnswers</code></em> schema document for the
|
|
21
|
+
version of the API you are using. </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both" id="d0e19853">The Structure of Answers</h2></div></div></div><p> A <em class="parameter"><code>QuestionFormAnswers</code></em> element contains an <em class="parameter"><code>Answer</code></em>
|
|
22
|
+
element for each question in the HIT or Qualification test for which the Worker provided an
|
|
23
|
+
answer. Each <em class="parameter"><code>Answer</code></em> contains a <em class="parameter"><code>QuestionIdentifier</code></em>
|
|
24
|
+
element whose value corresponds to the <em class="parameter"><code>QuestionIdentifier</code></em> of a
|
|
25
|
+
<em class="parameter"><code>Question</code></em> in the QuestionForm. See <a class="link" href="ApiReference_QuestionFormDataStructureArticle.html" title="QuestionForm">the QuestionForm data structure</a>
|
|
26
|
+
for more information about questions and answer specifications. </p><p> If the question expects a free-text answer, the <em class="parameter"><code>Answer</code></em> element contains
|
|
27
|
+
a <em class="parameter"><code>FreeText</code></em> element. This element contains the Worker's answer. </p><p> If the question expects a multiple-choice answer, the <em class="parameter"><code>Answer</code></em> element
|
|
28
|
+
contains a <em class="parameter"><code>SelectionIdentifier</code></em> element for each option the Worker selected.
|
|
29
|
+
If the Worker did not make any selections, the <em class="parameter"><code>Answer</code></em> will contain zero
|
|
30
|
+
<em class="parameter"><code>SelectionIdentifier</code></em> elements. The identifier corresponds to the
|
|
31
|
+
<em class="parameter"><code>SelectionIdentifier</code></em> for the selection provided in the answer
|
|
32
|
+
specification for the question. </p><p> If the multiple-choice question includes an <em class="parameter"><code>OtherSelection</code></em> field, and
|
|
33
|
+
the Worker enters data into this field, that data appears in the <em class="parameter"><code>Answer</code></em> in
|
|
34
|
+
an <em class="parameter"><code>OtherSelectionText</code></em> element. If the Worker both selects an option from
|
|
35
|
+
the list and provides text in this field, both values will be present in the answer. </p><p> If the question expects an uploaded file as an answer, the <em class="parameter"><code>Answer</code></em>
|
|
36
|
+
element contains an <em class="parameter"><code>UploadedFileSizeInBytes</code></em> element, and an
|
|
37
|
+
<em class="parameter"><code>UploadedFileKey</code></em> element. <em class="parameter"><code>UploadedFileSizeInBytes</code></em>
|
|
38
|
+
indicates the size of the file the Worker uploaded. <em class="parameter"><code>UploadedFileKey</code></em> is a
|
|
39
|
+
unique identifier for the file, unique with respect to other files that Workers may have uploaded.
|
|
40
|
+
To retrieve an uploaded file, your application calls the <code class="function">GetFileUploadURL</code>
|
|
41
|
+
operation, which returns a temporary URL your application can use to download the file. See <a class="link" href="ApiReference_GetFileUploadURLOperation.html" title="GetFileUploadURL">the GetFileUploadURL operation</a> for
|
|
42
|
+
more information on retrieving uploaded files. </p><p> Answer data will always conform to the answer specification provided in the HIT question, or in
|
|
43
|
+
the Qualification test question. </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both" id="d0e19940">Example</h2></div></div></div><p> The following is an example of a complete <em class="parameter"><code>QuestionFormAnswers</code></em> data
|
|
44
|
+
structure. Remember that this value will be returned as a single return value, XML escaped in the
|
|
45
|
+
response. </p><pre class="programlisting"><QuestionFormAnswers xmlns="<em class="replaceable"><code>[the QuestionFormAnswers schema URL]</code></em>">
|
|
46
|
+
<Answer>
|
|
47
|
+
<QuestionIdentifier>nextmove</QuestionIdentifier>
|
|
48
|
+
<FreeText>C3</FreeText>
|
|
49
|
+
</Answer>
|
|
50
|
+
<Answer>
|
|
51
|
+
<QuestionIdentifier>likelytowin</QuestionIdentifier>
|
|
52
|
+
<SelectionIdentifier>notlikely</SelectionIdentifier>
|
|
53
|
+
</Answer>
|
|
54
|
+
</QuestionFormAnswers></pre></div></div><div class="navfooter"><table width="100%" summary="Navigation footer" cellspacing="0" cellpadding="2"><tr><td width="30%" align="left"><a accesskey="p" href="ApiReference_FormattedContentXHTMLArticle.html"><img src="images/prev.gif" alt="Prev"></a> </td><td width="40%" align="center"><a href="http://survey.amazonwebservices.com/survey/s?s=559&opdata_page=Mturk_API_2008-08-02_ApiReference_QuestionFormAnswersDataStructureArticle">Documentation Feedback</a><br><a href="copyrightinfo.html">Copyright Information</a></td><td width="30%" align="right"> <a accesskey="n" href="ApiReference_AnswerKeyDataStructureArticle.html"><img src="images/next.gif" alt="Next"></a></td></tr><tr><td width="30%" align="left" valign="top"> </td><td width="40%" align="center"><a accesskey="h" href="#top"><img src="images/home.gif" alt="Home"></a></td><td width="30%" align="right" valign="top"> </td></tr></table></div></body></html>
|
|
@@ -0,0 +1,796 @@
|
|
|
1
|
+
<html xmlns:fo="http://www.w3.org/1999/XSL/Format"><head>
|
|
2
|
+
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
|
3
|
+
<title>QuestionForm</title><link rel="stylesheet" href="aws-docs-IE.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"><link rel="home" href="#top" title="Amazon Mechanical Turk"><link rel="up" href="ApiReference_QuestionAnswerDataArticle.html" title="Chapter 7. Question and Answer Data"><link rel="prev" href="ApiReference_XMLParameterValuesArticle.html" title="Using XML Parameter Values"><link rel="next" href="ApiReference_FormattedContentXHTMLArticle.html" title="Formatted Content: XHTML"><!--[if !IE]>--><link rel="stylesheet" href="aws-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"><!--<![endif]--><meta xmlns="http://www.w3.org/1999/xhtml" http-equiv="Content-Type" content="text/html; charset=utf-8"></meta><script src="/urchin.js" type="text/javascript"></script><script type="text/javascript">
|
|
4
|
+
urchinTracker();
|
|
5
|
+
</script><script xmlns="http://www.w3.org/1999/xhtml" type="text/javascript" src="frameset.js"> //
|
|
6
|
+
</script></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header" cellspacing="0" cellpadding="2"><tr><td width="30%" align="left"><a accesskey="p" href="ApiReference_XMLParameterValuesArticle.html"><img src="images/prev.gif" alt="Prev"></a> </td><td width="40%" align="center"><a href="http://survey.amazonwebservices.com/survey/s?s=559&opdata_page=Mturk_API_2008-08-02_ApiReference_QuestionFormDataStructureArticle">Documentation Feedback</a></td><td width="30%" align="right"> <a accesskey="n" href="ApiReference_FormattedContentXHTMLArticle.html"><img src="images/next.gif" alt="Next"></a></td></tr></table><div class="breadcrumb"><a href="Welcome.html">Welcome</a><a href=""></a> » <a href="ApiReference_QuestionAnswerDataArticle.html">Question and Answer Data</a> » <strong>QuestionForm</strong></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h1 class="topictitle">QuestionForm</h1></div></div></div><a class="indexterm" name="d0e17003"></a><a class="indexterm" name="d0e17006"></a><a class="indexterm" name="d0e17011"></a><a class="indexterm" name="d0e17016"></a><div class="highlights"><p><strong>Topics</strong></p><ul><li><a href="ApiReference_QuestionFormDataStructureArticle.html#d0e17024">Description</a></li><li><a href="ApiReference_QuestionFormDataStructureArticle.html#d0e17095">QuestionForm Structure</a></li><li><a href="ApiReference_QuestionFormDataStructureArticle.html#d0e17327">Content Structure</a></li><li><a href="ApiReference_QuestionFormDataStructureArticle.html#d0e18171">Answer Specification</a></li><li><a href="ApiReference_QuestionFormDataStructureArticle.html#d0e18973">Example</a></li></ul></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both" id="d0e17024">Description</h2></div></div></div><p> The <em class="parameter"><code>QuestionForm</code></em> data format describes one or more
|
|
7
|
+
<span class="emphasis"><em>questions</em></span> for a HIT, or for a Qualification test. It contains instructions
|
|
8
|
+
and data Workers use to answer the questions, and a set of one or more form fields, which are
|
|
9
|
+
rendered as a web form for a Worker to fill out and submit. </p><p> A <em class="parameter"><code>QuestionForm</code></em> is a string value that consists of XML data. The XML data
|
|
10
|
+
must conform to the <em class="parameter"><code>QuestionForm</code></em> schema. All elements in a
|
|
11
|
+
<em class="parameter"><code>QuestionForm</code></em> belong to a namespace whose name is identical to the URL
|
|
12
|
+
of the <em class="parameter"><code>QuestionForm</code></em> schema document. See <a class="link" href="ApiReference_WsdlLocationArticle.html" title="Chapter 3. WSDL and Schema Locations">WSDL and Schema Locations</a> for the location
|
|
13
|
+
of this schema. </p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Tip"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="images/tip.png"></td><th align="left">Tip</th></tr><tr><td align="left" valign="top"><p class="simpara"> For information about creating HITs that use your own web site in a frame instead of
|
|
14
|
+
questions, see <a class="link" href="ApiReference_ExternalQuestionArticle.html" title="ExternalQuestion">the ExternalQuestion data
|
|
15
|
+
structure</a>. </p></td></tr></table></div><p> The <em class="parameter"><code>QuestionForm</code></em> data structure is a value in a <a class="link" href="ApiReference_HITDataStructureArticle.html" title="HIT">HIT data structure</a> and a value in a
|
|
16
|
+
<a class="link" href="ApiReference_QualificationTypeDataStructureArticle.html" title="QualificationType"> QualificationType data
|
|
17
|
+
structure</a>. The <em class="parameter"><code>QuestionForm</code></em> data structure is used as a
|
|
18
|
+
parameter value for the following operations: </p><div class="itemizedlist"><ul type="disc"><li><p>
|
|
19
|
+
<code class="function">CreateHIT</code>
|
|
20
|
+
</p></li><li><p>
|
|
21
|
+
<code class="function">CreateQualificationType</code>
|
|
22
|
+
</p></li><li><p>
|
|
23
|
+
<code class="function">UpdateQualificationType</code>
|
|
24
|
+
</p></li></ul></div><p> For more information about using XML data as a parameter or return value, see <a class="link" href="ApiReference_XMLParameterValuesArticle.html" title="Using XML Parameter Values">Using XML Parameter Values</a>. </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both" id="d0e17095">QuestionForm Structure</h2></div></div></div><p> The top-most element of the <em class="parameter"><code>QuestionForm</code></em> data structure is a
|
|
25
|
+
<em class="parameter"><code>QuestionForm</code></em> element. This element contains optional
|
|
26
|
+
<em class="parameter"><code>Overview</code></em> elements and one or more <em class="parameter"><code>Question</code></em>
|
|
27
|
+
elements. There can be any number of these two element types listed in any order. The following
|
|
28
|
+
example structure has an <em class="parameter"><code>Overview</code></em> element and a
|
|
29
|
+
<em class="parameter"><code>Question</code></em> element followed by a second <em class="parameter"><code>Overview</code></em>
|
|
30
|
+
element and <em class="parameter"><code>Question</code></em> element—all within the same
|
|
31
|
+
<em class="parameter"><code>QuestionForm</code></em>. </p><pre class="programlisting"><QuestionForm xmlns="<em class="replaceable"><code>[the QuestionForm schema URL]</code></em>">
|
|
32
|
+
<Overview>
|
|
33
|
+
<em class="replaceable"><code>[...]</code></em>
|
|
34
|
+
</Overview>
|
|
35
|
+
<Question>
|
|
36
|
+
<em class="replaceable"><code>[...]</code></em>
|
|
37
|
+
</Question>
|
|
38
|
+
<Overview>
|
|
39
|
+
<em class="replaceable"><code>[...]</code></em>
|
|
40
|
+
</Overview>
|
|
41
|
+
<Question>
|
|
42
|
+
<em class="replaceable"><code>[...]</code></em>
|
|
43
|
+
</Question>
|
|
44
|
+
<em class="replaceable"><code>[...]</code></em>
|
|
45
|
+
</QuestionForm></pre><p> The <em class="parameter"><code>Overview</code></em> element describes instructions and information, and
|
|
46
|
+
presents them separately from the set of questions. It can contain any kind of informational
|
|
47
|
+
content, as described below. If omitted, no overview text is displayed above the questions. </p><p> Each <em class="parameter"><code>Question</code></em> element can contain the elements described in the
|
|
48
|
+
following table. See also the example below the table. </p><div class="informaltable"><table cellspacing="0" border="0"><colgroup><col><col><col></colgroup><thead><tr><th>Name</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td>
|
|
49
|
+
<p class="simpara">
|
|
50
|
+
<em class="parameter"><code>QuestionIdentifier</code></em>
|
|
51
|
+
</p>
|
|
52
|
+
</td><td>
|
|
53
|
+
<p class="simpara"> An identifier for the question. This identifier is used to associate the
|
|
54
|
+
Worker's answers with the question in the answer data. </p>
|
|
55
|
+
<p class="simpara">Type: String </p>
|
|
56
|
+
<p class="simpara">Default: None</p>
|
|
57
|
+
</td><td>
|
|
58
|
+
<p class="simpara">Yes</p>
|
|
59
|
+
</td></tr><tr><td>
|
|
60
|
+
<p class="simpara">
|
|
61
|
+
<em class="parameter"><code>DisplayName</code></em>
|
|
62
|
+
</p>
|
|
63
|
+
</td><td>
|
|
64
|
+
<p class="simpara"> A name for the question, displayed as a prominent heading. </p>
|
|
65
|
+
<p class="simpara">Type: String</p>
|
|
66
|
+
<p class="simpara">Default: None</p>
|
|
67
|
+
</td><td>
|
|
68
|
+
<p class="simpara">No</p>
|
|
69
|
+
</td></tr><tr><td>
|
|
70
|
+
<p class="simpara">
|
|
71
|
+
<em class="parameter"><code>IsRequired</code></em>
|
|
72
|
+
</p>
|
|
73
|
+
</td><td>
|
|
74
|
+
<p class="simpara"> Specifies whether the Worker must provide an answer for this question to
|
|
75
|
+
successfully submit the form. </p>
|
|
76
|
+
<p class="simpara">Type: Boolean</p>
|
|
77
|
+
<p class="simpara">Default: false</p>
|
|
78
|
+
<p class="simpara">Valid Values: true | false</p>
|
|
79
|
+
</td><td>
|
|
80
|
+
<p class="simpara">No</p>
|
|
81
|
+
</td></tr><tr><td>
|
|
82
|
+
<p class="simpara">
|
|
83
|
+
<em class="parameter"><code>QuestionContent</code></em>
|
|
84
|
+
</p>
|
|
85
|
+
</td><td>
|
|
86
|
+
<p class="simpara"> The instructions and data specific to this question, such as the text of
|
|
87
|
+
the question. It can contain any kind of informational content, as described
|
|
88
|
+
in the <em class="citetitle">Content Structure</em> section below. </p>
|
|
89
|
+
<p class="simpara">Type: Content structure</p>
|
|
90
|
+
<p class="simpara">Default: None</p>
|
|
91
|
+
</td><td>
|
|
92
|
+
<p class="simpara">Yes</p>
|
|
93
|
+
</td></tr><tr><td>
|
|
94
|
+
<p class="simpara">
|
|
95
|
+
<em class="parameter"><code>AnswerSpecification</code></em>
|
|
96
|
+
</p>
|
|
97
|
+
</td><td>
|
|
98
|
+
<p class="simpara"> A structure that describes the field type and possible values for the
|
|
99
|
+
answer to this question, as described in the <em class="citetitle">Answer
|
|
100
|
+
Specification</em> section below. This element controls how the form
|
|
101
|
+
field is rendered and specifies which values are valid answers for this
|
|
102
|
+
question. </p>
|
|
103
|
+
<p class="simpara">Type: An answer specification structure</p>
|
|
104
|
+
<p class="simpara">Default: None</p>
|
|
105
|
+
<p class="simpara"> Valid Values: <em class="parameter"><code>FreeTextAnswer</code></em> |
|
|
106
|
+
<em class="parameter"><code>SelectionAnswer</code></em> |
|
|
107
|
+
<em class="parameter"><code>FileUploadAnswer</code></em>
|
|
108
|
+
</p>
|
|
109
|
+
</td><td>
|
|
110
|
+
<p class="simpara">Yes</p>
|
|
111
|
+
</td></tr></tbody></table></div><p> For example: </p><pre class="programlisting"> <Question>
|
|
112
|
+
<QuestionIdentifier>my_question_id</QuestionIdentifier>
|
|
113
|
+
<DisplayName>My Question</DisplayName>
|
|
114
|
+
<IsRequired>true</IsRequired>
|
|
115
|
+
<QuestionContent>
|
|
116
|
+
<em class="replaceable"><code>[...]</code></em>
|
|
117
|
+
</QuestionContent>
|
|
118
|
+
<AnswerSpecification>
|
|
119
|
+
<em class="replaceable"><code>[...]</code></em>
|
|
120
|
+
</AnswerSpecification>
|
|
121
|
+
</Question></pre></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both" id="d0e17327">Content Structure</h2></div></div></div><p> The <em class="parameter"><code>Overview</code></em> elements and the <em class="parameter"><code>QuestionContent</code></em>
|
|
122
|
+
elements of a <em class="parameter"><code>QuestionForm</code></em> can contain different types of information. For
|
|
123
|
+
example, you might include a paragraph of text and an image in your HIT's overview. </p><p> Each kind of information is definded by a corresponding element. These elements can appear in
|
|
124
|
+
any number, in any order. The content elements are rendered in the order in which they occur in
|
|
125
|
+
the containing element. </p><p> Following are the allowed information types: </p><div class="itemizedlist"><ul type="disc"><li><em class="parameter"><code>Title</code></em></li><li><em class="parameter"><code>Text</code></em></li><li><em class="parameter"><code>List</code></em></li><li><em class="parameter"><code>Binary</code></em></li><li><em class="parameter"><code>Application</code></em></li><li><em class="parameter"><code>EmbeddedBinary</code></em></li><li><em class="parameter"><code>FormattedContent</code></em></li></ul></div><p> Each of these types are described in detail in the following subsections. A full example
|
|
126
|
+
showing the use of the elements and information types is at the end of the section. </p><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title" id="d0e17369">Title</h3></div></div></div><p> A <em class="parameter"><code>Title</code></em> element specifies a string to be rendered as a title or
|
|
127
|
+
heading. </p><pre class="programlisting"><Title>The Next Move</Title></pre></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title" id="d0e17379">Text</h3></div></div></div><p> A <em class="parameter"><code>Text</code></em> element specifies a block of text to be rendered as a
|
|
128
|
+
paragraph. Only plain text is allowed. HTML is not allowed. If HTML characters (such as angle
|
|
129
|
+
brackets) are included in the data, they appear verbatim in the web output. </p><pre class="programlisting"><Text>What is the best next move for "X" in this game of Tic-Tac-Toe?</Text></pre></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title" id="d0e17389">List</h3></div></div></div><p> A <em class="parameter"><code>List</code></em> element displays a bulleted list of items. Items are
|
|
130
|
+
specified using one or more <em class="parameter"><code>ListItem</code></em> elements inside the
|
|
131
|
+
<em class="parameter"><code>List</code></em>. The <em class="parameter"><code>ListItem</code></em> element is a string. </p><pre class="programlisting"><List>
|
|
132
|
+
<ListItem>It must be a valid move.</ListItem>
|
|
133
|
+
<ListItem>"X" cannot resign.</ListItem>
|
|
134
|
+
</List></pre></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title" id="d0e17408">Binary</h3></div></div></div><p> A <em class="parameter"><code>Binary</code></em> element specifies non-textual data of some kind, such as an
|
|
135
|
+
image, audio, or video. The elements listed in the following table are required and must be
|
|
136
|
+
entered in the order shown here. </p><div class="informaltable"><table cellspacing="0" border="0"><colgroup><col><col><col></colgroup><thead><tr><th>Name</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td>
|
|
137
|
+
<p class="simpara">
|
|
138
|
+
<em class="parameter"><code>MimeType</code></em>
|
|
139
|
+
</p>
|
|
140
|
+
</td><td>
|
|
141
|
+
<p class="simpara">Specifies the type of the data.</p>
|
|
142
|
+
<p class="simpara">Type: <em class="parameter"><code>MimeType</code></em> element</p>
|
|
143
|
+
<p class="simpara">Default: None</p>
|
|
144
|
+
<p class="simpara">Child Elements:</p>
|
|
145
|
+
<div class="itemizedlist"><ul type="disc"><li><div class="segmentedlist"><div class="seglistitem"><div class="seg"><strong><span class="segtitle">Type —</span></strong> A required string that specifies the type of the data.
|
|
146
|
+
The possible values are <strong class="userinput"><code>image</code></strong>,
|
|
147
|
+
<strong class="userinput"><code>audio</code></strong>, or
|
|
148
|
+
<strong class="userinput"><code>video</code></strong>. </div></div></div></li><li><div class="segmentedlist"><div class="seglistitem"><div class="seg"><strong><span class="segtitle">SubType —</span></strong>An optional string that specifies the format of the item,
|
|
149
|
+
such as <strong class="userinput"><code>gif</code></strong></div></div></div></li></ul></div>
|
|
150
|
+
</td><td>
|
|
151
|
+
<p class="simpara">Yes</p>
|
|
152
|
+
</td></tr><tr><td>
|
|
153
|
+
<p class="simpara">
|
|
154
|
+
<em class="parameter"><code>DataURL</code></em>
|
|
155
|
+
</p>
|
|
156
|
+
</td><td>
|
|
157
|
+
<p class="simpara"> The data itself specified with a <em class="parameter"><code>DataURL</code></em>
|
|
158
|
+
element that contains a valid HTTP URL. </p>
|
|
159
|
+
<p class="simpara">Type: <em class="parameter"><code>DataURL</code></em> element</p>
|
|
160
|
+
<p class="simpara">Default: None</p>
|
|
161
|
+
</td><td>
|
|
162
|
+
<p class="simpara">Yes</p>
|
|
163
|
+
</td></tr><tr><td>
|
|
164
|
+
<p class="simpara">
|
|
165
|
+
<em class="parameter"><code>AltText</code></em>
|
|
166
|
+
</p>
|
|
167
|
+
</td><td>
|
|
168
|
+
<p class="simpara"> The text that should appear if the data cannot be rendered in the
|
|
169
|
+
browser. </p>
|
|
170
|
+
<p class="simpara">Type: String</p>
|
|
171
|
+
<p class="simpara">Default: None</p>
|
|
172
|
+
</td><td>
|
|
173
|
+
<p class="simpara">Yes</p>
|
|
174
|
+
</td></tr></tbody></table></div><pre class="programlisting">
|
|
175
|
+
<Binary>
|
|
176
|
+
<MimeType>
|
|
177
|
+
<Type>image</Type>
|
|
178
|
+
<SubType>gif</SubType>
|
|
179
|
+
</MimeType>
|
|
180
|
+
<DataURL>http://tictactoe.amazon.com/game/01523/board.gif</DataURL>
|
|
181
|
+
<AltText>The game board, with "X" to move.</AltText>
|
|
182
|
+
</Binary>
|
|
183
|
+
</pre></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title" id="d0e17549">Application</h3></div></div></div><p> An <em class="parameter"><code>Application</code></em> element specifies an embedded application. It
|
|
184
|
+
contains either a <em class="parameter"><code>JavaApplet</code></em> element or a <em class="parameter"><code>Flash</code></em>
|
|
185
|
+
element. </p><p> You can specify zero or more parameters to pass to your Java applet or Flash application
|
|
186
|
+
when it is opened in the web page. For a HIT, in addition to the parameters you specify,
|
|
187
|
+
Amazon Mechanical Turk includes two parameters specific to the HIT: <code class="code">hitId</code> and
|
|
188
|
+
<code class="code">assignmentId</code>. The <code class="code">hitId</code> parameter is equal to the ID of the HIT.
|
|
189
|
+
The <code class="code">assignmentId</code> parameter is equal to the ID of the assignment if the Worker has
|
|
190
|
+
accepted the HIT, or equal to <code class="code">ASSIGNMENT_ID_NOT_AVAILABLE</code> if the Worker is only
|
|
191
|
+
previewing the HIT. </p><p> The <em class="parameter"><code>JavaApplet</code></em> element includes the elements described in the
|
|
192
|
+
following table: </p><div class="informaltable"><table cellspacing="0" border="0"><colgroup><col><col><col></colgroup><thead><tr><th>Name</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td>
|
|
193
|
+
<p class="simpara">
|
|
194
|
+
<em class="parameter"><code>AppletPath</code></em>
|
|
195
|
+
</p>
|
|
196
|
+
</td><td>
|
|
197
|
+
<p class="simpara">The URL path to the directory that contains Java classes for the
|
|
198
|
+
applet.</p>
|
|
199
|
+
<p class="simpara">Type: URL</p>
|
|
200
|
+
<p class="simpara">Default: None</p>
|
|
201
|
+
</td><td>
|
|
202
|
+
<p class="simpara">Yes</p>
|
|
203
|
+
</td></tr><tr><td>
|
|
204
|
+
<p class="simpara">
|
|
205
|
+
<em class="parameter"><code>AppletFilename</code></em>
|
|
206
|
+
</p>
|
|
207
|
+
</td><td>
|
|
208
|
+
<p class="simpara">The name of the class file that contains the applet code, which is
|
|
209
|
+
located in the path specified by <em class="parameter"><code>AppletPath</code></em>.</p>
|
|
210
|
+
<p class="simpara">Type: String</p>
|
|
211
|
+
<p class="simpara">Default: None</p>
|
|
212
|
+
</td><td>
|
|
213
|
+
<p class="simpara">Yes</p>
|
|
214
|
+
</td></tr><tr><td>
|
|
215
|
+
<p class="simpara">
|
|
216
|
+
<em class="parameter"><code>Width</code></em>
|
|
217
|
+
</p>
|
|
218
|
+
</td><td>
|
|
219
|
+
<p class="simpara">The width of the bounding box for the applet.</p>
|
|
220
|
+
<p class="simpara">Type: String</p>
|
|
221
|
+
<p class="simpara">Default: None</p>
|
|
222
|
+
</td><td>
|
|
223
|
+
<p class="simpara">Yes</p>
|
|
224
|
+
</td></tr><tr><td>
|
|
225
|
+
<p class="simpara">
|
|
226
|
+
<em class="parameter"><code>Height</code></em>
|
|
227
|
+
</p>
|
|
228
|
+
</td><td>
|
|
229
|
+
<p class="simpara">The height of the bounding box for the applet.</p>
|
|
230
|
+
<p class="simpara">Type: String</p>
|
|
231
|
+
<p class="simpara">Default: None</p>
|
|
232
|
+
</td><td>
|
|
233
|
+
<p class="simpara">Yes</p>
|
|
234
|
+
</td></tr><tr><td>
|
|
235
|
+
<p class="simpara">
|
|
236
|
+
<em class="parameter"><code>ApplicationParameter</code></em>
|
|
237
|
+
</p>
|
|
238
|
+
</td><td>
|
|
239
|
+
<p class="simpara">The parameters for the applet.</p>
|
|
240
|
+
<p class="simpara">Type: <em class="parameter"><code>ApplicationParameter</code></em>
|
|
241
|
+
</p>
|
|
242
|
+
<p class="simpara">Default: None</p>
|
|
243
|
+
<p class="simpara">Child Elements:</p>
|
|
244
|
+
<div class="itemizedlist"><ul type="disc"><li><div class="segmentedlist"><div class="seglistitem"><div class="seg"><strong><span class="segtitle">Name—</span></strong> A required string that specifies the name of the
|
|
245
|
+
parameter </div></div></div></li><li><div class="segmentedlist"><div class="seglistitem"><div class="seg"><strong><span class="segtitle">Value—</span></strong> A required string that specifies the value of the
|
|
246
|
+
parameter </div></div></div></li></ul></div>
|
|
247
|
+
</td><td>
|
|
248
|
+
<p class="simpara">No</p>
|
|
249
|
+
</td></tr></tbody></table></div><p> The <em class="parameter"><code>Flash</code></em> element includes the elements described in the following
|
|
250
|
+
table: </p><div class="informaltable"><table cellspacing="0" border="0"><colgroup><col><col><col></colgroup><thead><tr><th>Name</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td>
|
|
251
|
+
<p class="simpara">
|
|
252
|
+
<em class="parameter"><code>FlashMovieURL</code></em>
|
|
253
|
+
</p>
|
|
254
|
+
</td><td>
|
|
255
|
+
<p class="simpara">The URL of the Flash movie file.</p>
|
|
256
|
+
<p class="simpara">Type: URL</p>
|
|
257
|
+
<p class="simpara">Default: None</p>
|
|
258
|
+
</td><td>
|
|
259
|
+
<p class="simpara">Yes</p>
|
|
260
|
+
</td></tr><tr><td>
|
|
261
|
+
<p class="simpara">
|
|
262
|
+
<em class="parameter"><code>Width</code></em>
|
|
263
|
+
</p>
|
|
264
|
+
</td><td>
|
|
265
|
+
<p class="simpara">The width of the bounding box for the Flash movie.</p>
|
|
266
|
+
<p class="simpara">Type: String</p>
|
|
267
|
+
<p class="simpara">Default: None</p>
|
|
268
|
+
</td><td>
|
|
269
|
+
<p class="simpara">Yes</p>
|
|
270
|
+
</td></tr><tr><td>
|
|
271
|
+
<p class="simpara">
|
|
272
|
+
<em class="parameter"><code>Height</code></em>
|
|
273
|
+
</p>
|
|
274
|
+
</td><td>
|
|
275
|
+
<p class="simpara">The height of the bounding box for the Flash movie.</p>
|
|
276
|
+
<p class="simpara">Type: String</p>
|
|
277
|
+
<p class="simpara">Default: None</p>
|
|
278
|
+
</td><td>
|
|
279
|
+
<p class="simpara">Yes</p>
|
|
280
|
+
</td></tr><tr><td>
|
|
281
|
+
<p class="simpara">
|
|
282
|
+
<em class="parameter"><code>ApplicationParameter</code></em>
|
|
283
|
+
</p>
|
|
284
|
+
</td><td>
|
|
285
|
+
<p class="simpara"> The parameters for the Flash movie. </p>
|
|
286
|
+
<p class="simpara">Type: <em class="parameter"><code>ApplicationParameter</code></em>
|
|
287
|
+
</p>
|
|
288
|
+
<p class="simpara">Default: None</p>
|
|
289
|
+
<p class="simpara">Child Elements:</p>
|
|
290
|
+
<div class="itemizedlist"><ul type="disc"><li><div class="segmentedlist"><div class="seglistitem"><div class="seg"><strong><span class="segtitle">Name —</span></strong> A required string that specifies the name of the
|
|
291
|
+
parameter </div></div></div></li><li><div class="segmentedlist"><div class="seglistitem"><div class="seg"><strong><span class="segtitle">Value—</span></strong> A required string that specifies the value of the
|
|
292
|
+
parameter </div></div></div></li></ul></div>
|
|
293
|
+
</td><td>
|
|
294
|
+
<p class="simpara">No</p>
|
|
295
|
+
</td></tr></tbody></table></div><pre class="programlisting"><Application>
|
|
296
|
+
<JavaApplet>
|
|
297
|
+
<AppletPath>http://tictactoe.amazon.com/applets/</AppletPath>
|
|
298
|
+
<AppletFilename>GameViewer.class</AppletFilename>
|
|
299
|
+
<Width>400</Width>
|
|
300
|
+
<Height>300</Height>
|
|
301
|
+
<ApplicationParameter>
|
|
302
|
+
<Name>game_id<Name>
|
|
303
|
+
<Value>01523</Value>
|
|
304
|
+
</ApplicationParameter>
|
|
305
|
+
</JavaApplet>
|
|
306
|
+
</Application></pre></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title" id="d0e17905">EmbeddedBinary</h3></div></div></div><p> An <em class="parameter"><code>EmbeddedBinary</code></em> element specifies an external object of
|
|
307
|
+
non-textual data of some kind, such as an image, audio or video, that displays in your
|
|
308
|
+
browser. The elements listed in the following table are required and must be entered in the
|
|
309
|
+
order shown here. </p><div class="informaltable"><table cellspacing="0" border="0"><colgroup><col><col><col></colgroup><thead><tr><th>Name</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td>
|
|
310
|
+
<p class="simpara">
|
|
311
|
+
<em class="parameter"><code>EmbeddedMimeType</code></em>
|
|
312
|
+
</p>
|
|
313
|
+
</td><td>
|
|
314
|
+
<p class="simpara">Specifies the type of the data.</p>
|
|
315
|
+
<p class="simpara">Type: <em class="parameter"><code>EmbeddedMimeType</code></em> element</p>
|
|
316
|
+
<p class="simpara">Default: None</p>
|
|
317
|
+
<p class="simpara">Child Elements:</p>
|
|
318
|
+
<div class="itemizedlist"><ul type="disc"><li><div class="segmentedlist"><div class="seglistitem"><div class="seg"><strong><span class="segtitle">Type —</span></strong> A required string that specifies the type of the data.
|
|
319
|
+
The possible values are <strong class="userinput"><code>image</code></strong>,
|
|
320
|
+
<strong class="userinput"><code>audio</code></strong>, or
|
|
321
|
+
<strong class="userinput"><code>video</code></strong>.</div></div></div></li><li><div class="segmentedlist"><div class="seglistitem"><div class="seg"><strong><span class="segtitle">SubType —</span></strong>An optional string that specifies the format of the item,
|
|
322
|
+
such as <strong class="userinput"><code>gif</code></strong></div></div></div></li></ul></div>
|
|
323
|
+
</td><td>
|
|
324
|
+
<p class="simpara">Yes</p>
|
|
325
|
+
</td></tr><tr><td>
|
|
326
|
+
<p class="simpara">
|
|
327
|
+
<em class="parameter"><code>DataURL</code></em>
|
|
328
|
+
</p>
|
|
329
|
+
</td><td>
|
|
330
|
+
<p class="simpara"> The data itself specified by a <em class="parameter"><code>DataURL</code></em>
|
|
331
|
+
element that contains a valid HTTP URL </p>
|
|
332
|
+
<p class="simpara">Type: <em class="parameter"><code>DataURL</code></em> element</p>
|
|
333
|
+
<p class="simpara">Default: None</p>
|
|
334
|
+
</td><td>
|
|
335
|
+
<p class="simpara">Yes</p>
|
|
336
|
+
</td></tr><tr><td>
|
|
337
|
+
<p class="simpara">
|
|
338
|
+
<em class="parameter"><code>AltText</code></em>
|
|
339
|
+
</p>
|
|
340
|
+
</td><td>
|
|
341
|
+
<p class="simpara"> The text that should appear if the data cannot be rendered in the
|
|
342
|
+
browser. </p>
|
|
343
|
+
<p class="simpara">Type: String</p>
|
|
344
|
+
<p class="simpara">Default: None</p>
|
|
345
|
+
</td><td>
|
|
346
|
+
<p class="simpara">Yes</p>
|
|
347
|
+
</td></tr><tr><td>
|
|
348
|
+
<p class="simpara">
|
|
349
|
+
<em class="parameter"><code>Width</code></em>
|
|
350
|
+
</p>
|
|
351
|
+
</td><td>
|
|
352
|
+
<p class="simpara"> The width of the bounding box for the object. </p>
|
|
353
|
+
<p class="simpara">Type: String</p>
|
|
354
|
+
<p class="simpara">Default: None</p>
|
|
355
|
+
</td><td>
|
|
356
|
+
<p class="simpara">Yes</p>
|
|
357
|
+
</td></tr><tr><td>
|
|
358
|
+
<p class="simpara">
|
|
359
|
+
<em class="parameter"><code>Height</code></em>
|
|
360
|
+
</p>
|
|
361
|
+
</td><td>
|
|
362
|
+
<p class="simpara"> The height of the bounding box for the object. </p>
|
|
363
|
+
<p class="simpara">Type: String</p>
|
|
364
|
+
<p class="simpara">Default: None</p>
|
|
365
|
+
</td><td>
|
|
366
|
+
<p class="simpara">Yes</p>
|
|
367
|
+
</td></tr><tr><td>
|
|
368
|
+
<p class="simpara">
|
|
369
|
+
<em class="parameter"><code>ApplicationParameter</code></em>
|
|
370
|
+
</p>
|
|
371
|
+
</td><td>
|
|
372
|
+
<p class="simpara">The parameters for the <em class="parameter"><code>EmbeddedBinary</code></em> object. </p>
|
|
373
|
+
<p class="simpara">Type: <em class="parameter"><code>ApplicationParameter</code></em>
|
|
374
|
+
</p>
|
|
375
|
+
<p class="simpara">Default: None</p>
|
|
376
|
+
<p class="simpara">Child elements:</p>
|
|
377
|
+
<div class="itemizedlist"><ul type="disc"><li><div class="segmentedlist"><div class="seglistitem"><div class="seg"><strong><span class="segtitle">Name —</span></strong> A required string that specifies the name of the
|
|
378
|
+
parameter</div></div></div></li><li><div class="segmentedlist"><div class="seglistitem"><div class="seg"><strong><span class="segtitle">Value—</span></strong> A required string that specifies the value of the
|
|
379
|
+
parameter</div></div></div></li></ul></div>
|
|
380
|
+
</td><td>
|
|
381
|
+
<p class="simpara">No</p>
|
|
382
|
+
</td></tr></tbody></table></div><pre class="programlisting"><EmbeddedBinary>
|
|
383
|
+
<EmbeddedMimeType>
|
|
384
|
+
<Type>image</Type>
|
|
385
|
+
<SubType>gif</SubType>
|
|
386
|
+
</EmbeddedMimeType>
|
|
387
|
+
<DataURL>http://tictactoe.amazon.com/game/01523/board.gif</DataURL>
|
|
388
|
+
<AltText>The game board, with "X" to move.</AltText>
|
|
389
|
+
<Width>400</Width>
|
|
390
|
+
<Height>300</Height>
|
|
391
|
+
<ApplicationParameter>
|
|
392
|
+
<Name>game_id<Name>
|
|
393
|
+
<Value>01523</Value>
|
|
394
|
+
</ApplicationParameter>
|
|
395
|
+
</EmbeddedBinary></pre></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title" id="d0e18149">FormattedContent</h3></div></div></div><p> For finer control over the display of your HIT information, you can specify a
|
|
396
|
+
<em class="parameter"><code>FormattedContent</code></em> element. Formatted content is a block of text with
|
|
397
|
+
formatting information specified using XHTML tags. For example, you can use XHTML tags to
|
|
398
|
+
specify that certain words appear in a boldface font or to include a table in your HIT
|
|
399
|
+
information. </p><p> Only a limited subset of XHTML is supported. For more information on the creating and
|
|
400
|
+
validating XHTML formatted content, see <a class="link" href="ApiReference_FormattedContentXHTMLArticle.html" title="Formatted Content: XHTML">Formatted Content: XHTML</a>. </p><p> The value of the <em class="parameter"><code>FormattedContent</code></em> element must be specified as an
|
|
401
|
+
XML CDATA block. CDATA tells the web service that the XHTML elements are not part of the
|
|
402
|
+
<em class="parameter"><code>QuestionForm</code></em> data schema. For example, the following describes a
|
|
403
|
+
paragraph of formatted text: </p><pre class="programlisting"><FormattedContent><![CDATA[
|
|
404
|
+
<p>This is a paragraph with <b>bold text</b>,
|
|
405
|
+
<i>italic text</i>, and <b><i>bold italic text</i></b>.</p>
|
|
406
|
+
]]></FormattedContent></pre></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both" id="d0e18171">Answer Specification</h2></div></div></div><a class="indexterm" name="d0e18174"></a><a class="indexterm" name="d0e18179"></a><a class="indexterm" name="d0e18184"></a><p> The <em class="parameter"><code>AnswerSpecification</code></em> element describes the format and possible values
|
|
407
|
+
for answers to a question. It contains a <em class="parameter"><code>FreeTextAnswer</code></em> element, which
|
|
408
|
+
describes a text field; a <em class="parameter"><code>SelectionAnswer</code></em> element, which describes a
|
|
409
|
+
multiple choice field; or a <em class="parameter"><code>FileUploadAnswer</code></em>, which prompts the Worker to
|
|
410
|
+
upload a file as the answer to the question. </p><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title" id="d0e18203">FreeTextAnswer</h3></div></div></div><p> A <em class="parameter"><code>FreeTextAnswer</code></em> element describes a text field and constraints on
|
|
411
|
+
its possible values. It includes the elements described in the following table: </p><div class="informaltable"><table cellspacing="0" border="0"><colgroup><col><col><col></colgroup><thead><tr><th>Name</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td>
|
|
412
|
+
<p class="simpara">
|
|
413
|
+
<em class="parameter"><code>Constraints</code></em>
|
|
414
|
+
</p>
|
|
415
|
+
</td><td>
|
|
416
|
+
<p class="simpara"> Describes the constraints on the allowed values for the text field.
|
|
417
|
+
This element is described in the next table. </p>
|
|
418
|
+
<p class="simpara">Type: <em class="parameter"><code>Constraints</code></em> element</p>
|
|
419
|
+
<p class="simpara">Default: None</p>
|
|
420
|
+
</td><td>
|
|
421
|
+
<p class="simpara">No</p>
|
|
422
|
+
</td></tr><tr><td>
|
|
423
|
+
<p class="simpara">
|
|
424
|
+
<em class="parameter"><code>DefaultText</code></em>
|
|
425
|
+
</p>
|
|
426
|
+
</td><td>
|
|
427
|
+
<p class="simpara"> Specifies default text. This value appears in the form when it is
|
|
428
|
+
rendered, and is accepted as the answer if the Worker does not change it. </p>
|
|
429
|
+
<p class="simpara">Type: String</p>
|
|
430
|
+
<p class="simpara">Default: An empty value</p>
|
|
431
|
+
</td><td>
|
|
432
|
+
<p class="simpara">No</p>
|
|
433
|
+
</td></tr><tr><td>
|
|
434
|
+
<p class="simpara">
|
|
435
|
+
<em class="parameter"><code>NumberOfLinesSuggestion</code></em>
|
|
436
|
+
</p>
|
|
437
|
+
</td><td>
|
|
438
|
+
<p class="simpara"> Specifies how tall the form field should be, if possible. The field
|
|
439
|
+
might be rendered as a text box with this many lines, depending on the
|
|
440
|
+
device the Worker is using to see the form. </p>
|
|
441
|
+
<p class="simpara">Type: Integer</p>
|
|
442
|
+
<p class="simpara">Default: 1</p>
|
|
443
|
+
</td><td>
|
|
444
|
+
<p class="simpara">No</p>
|
|
445
|
+
</td></tr></tbody></table></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p class="simpara"> A Qualification test that is to be graded automatically using an answer key cannot
|
|
446
|
+
have any free-text questions. An answer key can only match multiple-choice questions and
|
|
447
|
+
cannot match free-text fields. </p></td></tr></table></div><p> The optional <em class="parameter"><code>Constraints</code></em> element describes constraints on the
|
|
448
|
+
allowed values for the text field. If no constraints are specified, any value is accepted for
|
|
449
|
+
the field. </p><p> The <em class="parameter"><code>Constraints</code></em> element includes the elements described in the
|
|
450
|
+
following table: </p><div class="informaltable"><table cellspacing="0" border="0"><colgroup><col><col><col></colgroup><thead><tr><th>Name</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td>
|
|
451
|
+
<p class="simpara">
|
|
452
|
+
<em class="parameter"><code>IsNumeric</code></em>
|
|
453
|
+
</p>
|
|
454
|
+
</td><td>
|
|
455
|
+
<p class="simpara">Specifies that the value entered must be numeric.</p>
|
|
456
|
+
<p class="simpara">Type: empty element</p>
|
|
457
|
+
<p class="simpara">Default: None</p>
|
|
458
|
+
<p class="simpara">Attributes:</p>
|
|
459
|
+
<div class="itemizedlist"><ul type="disc"><li><div class="segmentedlist"><div class="seglistitem"><div class="seg"><strong><span class="segtitle">minValue —</span></strong>An optional integer that specifies the minimum value
|
|
460
|
+
allowed</div></div></div></li><li><div class="segmentedlist"><div class="seglistitem"><div class="seg"><strong><span class="segtitle">maxValue —</span></strong>An optional integer that specifies the maximum value
|
|
461
|
+
allowed</div></div></div></li></ul></div>
|
|
462
|
+
</td><td>
|
|
463
|
+
<p class="simpara">No</p>
|
|
464
|
+
</td></tr><tr><td>
|
|
465
|
+
<p class="simpara">
|
|
466
|
+
<em class="parameter"><code>Length</code></em>
|
|
467
|
+
</p>
|
|
468
|
+
</td><td>
|
|
469
|
+
<p class="simpara">Specifies the length range of the answer.</p>
|
|
470
|
+
<p class="simpara">Type: empty element</p>
|
|
471
|
+
<p class="simpara">Default: None</p>
|
|
472
|
+
<p class="simpara">Attributes:</p>
|
|
473
|
+
<div class="itemizedlist"><ul type="disc"><li><div class="segmentedlist"><div class="seglistitem"><div class="seg"><strong><span class="segtitle">minLength—</span></strong> An optional non-negative integer that specifies the
|
|
474
|
+
minimum number of characters </div></div></div></li><li><div class="segmentedlist"><div class="seglistitem"><div class="seg"><strong><span class="segtitle">maxLength —</span></strong> An optional positive integer that specifies the maximum
|
|
475
|
+
number of characters </div></div></div></li></ul></div>
|
|
476
|
+
</td><td>
|
|
477
|
+
<p class="simpara">No</p>
|
|
478
|
+
</td></tr><tr><td>
|
|
479
|
+
<p class="simpara">
|
|
480
|
+
<em class="parameter"><code>AnswerFormatRegex</code></em>
|
|
481
|
+
</p>
|
|
482
|
+
</td><td>
|
|
483
|
+
<p class="simpara"> Specifies that JavaScript validates the answer string against a
|
|
484
|
+
given pattern. </p>
|
|
485
|
+
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p class="simpara"> A limitation of this approach is that Workers who have disabled
|
|
486
|
+
JavaScript on their browsers cannot validate their answers. Although
|
|
487
|
+
this is uncommon, you might want to caution your Workers. </p></td></tr></table></div>
|
|
488
|
+
<p class="simpara">Type: empty element</p>
|
|
489
|
+
<p class="simpara">Default: None</p>
|
|
490
|
+
<p class="simpara">Attributes:</p>
|
|
491
|
+
<div class="itemizedlist"><ul type="disc"><li><div class="segmentedlist"><div class="seglistitem"><div class="seg"><strong><span class="segtitle">regex—</span></strong>A required string that specifies the regular expression
|
|
492
|
+
that JavaScript uses to validate against the Workers'
|
|
493
|
+
entered values</div></div></div></li><li><div class="segmentedlist"><div class="seglistitem"><div class="seg"><strong><span class="segtitle">errorText—</span></strong>An optional string that allows you to edit the content of
|
|
494
|
+
errors displayed to the Worker on the Worker web site if
|
|
495
|
+
the regex validation fails. If this attribute is not
|
|
496
|
+
specified, the error displayed is "Invalid input
|
|
497
|
+
supplied." </div></div></div></li><li><div class="segmentedlist"><div class="seglistitem"><div class="seg"><strong><span class="segtitle">flags—</span></strong>An optional string with the value <code class="code">i</code> which
|
|
498
|
+
specifies that case is ignored when matching characters
|
|
499
|
+
</div></div></div></li></ul></div>
|
|
500
|
+
</td><td>
|
|
501
|
+
<p class="simpara">No</p>
|
|
502
|
+
</td></tr></tbody></table></div><p> The <em class="parameter"><code>Constraints</code></em> element can contain multiple
|
|
503
|
+
<em class="parameter"><code>AnswerFormatRegex</code></em> elements. All
|
|
504
|
+
<em class="parameter"><code>AnswerFormatRegex</code></em> constraints must be satisfied before the Worker can
|
|
505
|
+
submit the HIT. For more information about JavaScript RegExp and how to use it, go to the
|
|
506
|
+
<a class="ulink" href="http://devedge-temp.mozilla.org/library/manuals/2000/javascript/1.5/reference/contents.html" target="_blank"> Core JavaScript Reference</a> at Mozilla.org. </p><p> The following examples demonstrate how to use the <em class="parameter"><code>FreeTextAnswer</code></em>
|
|
507
|
+
element. </p><p> If you want a 3-digit positive integer between 100 and 999, use the following:
|
|
508
|
+
</p><pre class="programlisting">
|
|
509
|
+
<FreeTextAnswer>
|
|
510
|
+
<Constraints>
|
|
511
|
+
<IsNumeric minValue="100" maxValue="999"/>
|
|
512
|
+
<Length minLength="3" maxLength="3"/>
|
|
513
|
+
</Constraints>
|
|
514
|
+
</FreeTextAnswer>
|
|
515
|
+
</pre><p>
|
|
516
|
+
</p><p> If you want a 3-digit number that includes decimals, use the following:
|
|
517
|
+
</p><pre class="programlisting">
|
|
518
|
+
<FreeTextAnswer>
|
|
519
|
+
<Constraints>
|
|
520
|
+
<IsNumeric/>
|
|
521
|
+
<Length minLength="3" maxLength="3"/>
|
|
522
|
+
</Constraints>
|
|
523
|
+
</FreeTextAnswer>
|
|
524
|
+
</pre><p>
|
|
525
|
+
</p><p> If you want to ensure that there is some text, use the following example. The
|
|
526
|
+
<strong class="userinput"><code>minLength</code></strong> attribute includes whitespaces in the character count.
|
|
527
|
+
</p><pre class="programlisting">
|
|
528
|
+
<FreeTextAnswer>
|
|
529
|
+
<Constraints>
|
|
530
|
+
<Length minLength="2" />
|
|
531
|
+
<AnswerFormatRegex regex="\S" errorText="The content cannot be blank."/>
|
|
532
|
+
</Constraints>
|
|
533
|
+
</FreeTextAnswer>
|
|
534
|
+
</pre><p>
|
|
535
|
+
</p><p> If you specify the <strong class="userinput"><code>minLength</code></strong> attribute, it is the same as if the
|
|
536
|
+
<em class="parameter"><code> IsRequired </code></em> element is <code class="code">true</code>. If you want tp allow an
|
|
537
|
+
<span class="emphasis"><em>optional</em></span> string that must be at least two characters, use the
|
|
538
|
+
following:
|
|
539
|
+
</p><pre class="programlisting">
|
|
540
|
+
<FreeTextAnswer>
|
|
541
|
+
<Constraints>
|
|
542
|
+
<AnswerFormatRegex regex="(^$|\S{2,})"
|
|
543
|
+
errorText="You must enter at least two characters."/>
|
|
544
|
+
</Constraints>
|
|
545
|
+
</FreeTextAnswer>
|
|
546
|
+
</pre><p>
|
|
547
|
+
</p><p> To request a US phone number in the format 1-nnn-nnn-nnnn, where "1-" is
|
|
548
|
+
optional, use the following:
|
|
549
|
+
</p><pre class="programlisting">
|
|
550
|
+
<FreeTextAnswer>
|
|
551
|
+
<Constraints>
|
|
552
|
+
<AnswerFormatRegex
|
|
553
|
+
regex="^(1[- ]?)?(\([2-9]\d{2}\)\s*|[2-9]\d{2}-?)[2-9]\d{2}-?\d{4}$)"
|
|
554
|
+
errorText="You must enter a US phone number in the format
|
|
555
|
+
1-555-555-1234 or 555-555-1234."/>
|
|
556
|
+
</Constraints>
|
|
557
|
+
</FreeTextAnswer>
|
|
558
|
+
</pre><p>
|
|
559
|
+
</p><p> If you want an answer that contains a date formatted as yyyy-mm-dd, use the following:
|
|
560
|
+
</p><pre class="programlisting">
|
|
561
|
+
<FreeTextAnswer>
|
|
562
|
+
<Constraints>
|
|
563
|
+
<AnswerFormatRegex regex="^[12][0-9]{3}-[01]?\d-[0-3]?\d$"
|
|
564
|
+
errorText="You must enter a date with the format yyyy-mm-dd."/>
|
|
565
|
+
</Constraints>
|
|
566
|
+
</FreeTextAnswer>
|
|
567
|
+
</pre><p>
|
|
568
|
+
</p><p> If you want an answer that contains "regex" and variations including
|
|
569
|
+
RegEx, REGex, and RegExes, use the following:
|
|
570
|
+
</p><pre class="programlisting">
|
|
571
|
+
<FreeTextAnswer>
|
|
572
|
+
<Constraints>
|
|
573
|
+
<AnswerFormatRegex regex="regex" flags="i"
|
|
574
|
+
errorText="You must enter 'regex'."/>
|
|
575
|
+
</Constraints>
|
|
576
|
+
</FreeTextAnswer>
|
|
577
|
+
</pre><p>
|
|
578
|
+
</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title" id="d0e18558">SelectionAnswer</h3></div></div></div><p> A <em class="parameter"><code>SelectionAnswer</code></em> describes a multiple-choice question. Depending on
|
|
579
|
+
the element defined, the Worker might be able to select zero, one, or multiple items from a
|
|
580
|
+
set list as the answer to the question. </p><p> A <em class="parameter"><code>SelectionAnswer</code></em> element includes the elements described in the
|
|
581
|
+
following table: </p><div class="informaltable"><table cellspacing="0" border="0"><colgroup><col><col><col></colgroup><thead><tr><th>Name</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td>
|
|
582
|
+
<p class="simpara">
|
|
583
|
+
<em class="parameter"><code>MinSelectionCount</code></em>
|
|
584
|
+
</p>
|
|
585
|
+
</td><td>
|
|
586
|
+
<p class="simpara"> Specifies the minimum number of selections allowed for a valid
|
|
587
|
+
answer. This value can range from 0 to the number of selections. </p>
|
|
588
|
+
<p class="simpara">Type: non-negative Integer</p>
|
|
589
|
+
<p class="simpara">Default: 1</p>
|
|
590
|
+
</td><td>
|
|
591
|
+
<p class="simpara">No</p>
|
|
592
|
+
</td></tr><tr><td>
|
|
593
|
+
<p class="simpara">
|
|
594
|
+
<em class="parameter"><code>MaxSelectionCount</code></em>
|
|
595
|
+
</p>
|
|
596
|
+
</td><td>
|
|
597
|
+
<p class="simpara"> Specifies the maximum number of selections allowed for a valid
|
|
598
|
+
answer. This value can range from 1 to the number of selections. </p>
|
|
599
|
+
<p class="simpara">Type: positive Integer</p>
|
|
600
|
+
<p class="simpara">Default: 1</p>
|
|
601
|
+
</td><td>
|
|
602
|
+
<p class="simpara">No</p>
|
|
603
|
+
</td></tr><tr><td>
|
|
604
|
+
<p class="simpara">
|
|
605
|
+
<em class="parameter"><code>StyleSuggestions</code></em>
|
|
606
|
+
</p>
|
|
607
|
+
</td><td>
|
|
608
|
+
<p class="simpara"> Specifies what style of multiple-choice form field to use when
|
|
609
|
+
displaying the question to the Worker. The field might not use the
|
|
610
|
+
suggested style, depending on the device the Worker is using to see the
|
|
611
|
+
form. </p>
|
|
612
|
+
<p class="simpara">Type: String</p>
|
|
613
|
+
<p class="simpara">Default: None</p>
|
|
614
|
+
<p class="simpara">Valid Values:</p>
|
|
615
|
+
<div class="itemizedlist"><ul type="disc"><li><div class="segmentedlist"><div class="seglistitem"><div class="seg"><strong><span class="segtitle">radiobutton—</span></strong> Can be used if <em class="parameter"><code>MaxSelectionCount</code></em>
|
|
616
|
+
is <strong class="userinput"><code>1</code></strong>, because it restricts the user
|
|
617
|
+
to selecting either zero or one item from the list </div></div></div></li><li><div class="segmentedlist"><div class="seglistitem"><div class="seg"><strong><span class="segtitle">checkbox—</span></strong> Allows multiple selections, but can be restricted by
|
|
618
|
+
using the <em class="parameter"><code>MaxSelectionCount</code></em> element
|
|
619
|
+
</div></div></div></li><li><div class="segmentedlist"><div class="seglistitem"><div class="seg"><strong><span class="segtitle">list—</span></strong> Allows multiple selections, but can be restricted by
|
|
620
|
+
using the <em class="parameter"><code>MaxSelectionCount</code></em> element
|
|
621
|
+
</div></div></div></li><li><div class="segmentedlist"><div class="seglistitem"><div class="seg"><strong><span class="segtitle">dropdown—</span></strong> Can be used if <em class="parameter"><code>MaxSelectionCount</code></em>
|
|
622
|
+
is <strong class="userinput"><code>1</code></strong>, because it restricts the user
|
|
623
|
+
to selecting either zero or one item from the list </div></div></div></li><li><div class="segmentedlist"><div class="seglistitem"><div class="seg"><strong><span class="segtitle">combobox—</span></strong> Allows multiple selections, but can be restricted by
|
|
624
|
+
using the <em class="parameter"><code>MaxSelectionCount</code></em> element
|
|
625
|
+
</div></div></div></li><li><div class="segmentedlist"><div class="seglistitem"><div class="seg"><strong><span class="segtitle">multichooser—</span></strong> Allows multiple selections, but can be restricted by
|
|
626
|
+
using the <em class="parameter"><code>MaxSelectionCount</code></em> element
|
|
627
|
+
</div></div></div></li></ul></div>
|
|
628
|
+
</td><td>
|
|
629
|
+
<p class="simpara">No</p>
|
|
630
|
+
</td></tr><tr><td>
|
|
631
|
+
<p class="simpara">
|
|
632
|
+
<em class="parameter"><code>Selections</code></em>
|
|
633
|
+
</p>
|
|
634
|
+
</td><td>
|
|
635
|
+
<p class="simpara">Specifies the answer selections.</p>
|
|
636
|
+
<p class="simpara">Type: <em class="parameter"><code>Selections</code></em> structure</p>
|
|
637
|
+
<p class="simpara">Default: None</p>
|
|
638
|
+
<p class="simpara">Child elements:</p>
|
|
639
|
+
<div class="itemizedlist"><ul type="disc"><li><div class="segmentedlist"><div class="seglistitem"><div class="seg"><strong><span class="segtitle">Selection—</span></strong> Specifies an answer selection. This element is described
|
|
640
|
+
fully in the next table. </div></div></div></li><li><div class="segmentedlist"><div class="seglistitem"><div class="seg"><strong><span class="segtitle">OtherSelection—</span></strong> An optional text field to display below the selection
|
|
641
|
+
list that allows the Worker to enter an alternate answer
|
|
642
|
+
that does not appear in the list of selections. The
|
|
643
|
+
contents of this element are similar to
|
|
644
|
+
<em class="parameter"><code>FreeTextAnswer</code></em>. </div></div></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p> A Qualification test that you want to grade automatically
|
|
645
|
+
using an answer key cannot have an
|
|
646
|
+
<em class="parameter"><code>OtherSelection</code></em> field for a multiple
|
|
647
|
+
choice question. An answer key can only match multiple-choice
|
|
648
|
+
questions and cannot match free-text fields. </p></td></tr></table></div></li></ul></div>
|
|
649
|
+
</td><td>
|
|
650
|
+
<p class="simpara">Yes</p>
|
|
651
|
+
</td></tr></tbody></table></div><p> The <em class="parameter"><code>Selections</code></em> element lists the selection options available. It
|
|
652
|
+
contains one or more <em class="parameter"><code>Selection</code></em> elements, one for each possible answer
|
|
653
|
+
in the set. The <em class="parameter"><code>Selection</code></em> element includes the elements described in
|
|
654
|
+
the following table: </p><div class="informaltable"><table cellspacing="0" border="0"><colgroup><col><col><col></colgroup><thead><tr><th>Name</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td>
|
|
655
|
+
<p class="simpara">
|
|
656
|
+
<em class="parameter"><code>SelectionIdentifier</code></em>
|
|
657
|
+
</p>
|
|
658
|
+
</td><td>
|
|
659
|
+
<p class="simpara"> A unique alphanumeric string that is in the answer data if this
|
|
660
|
+
selection is chosen. </p>
|
|
661
|
+
<p class="simpara">Type: String</p>
|
|
662
|
+
<p class="simpara">Default: None</p>
|
|
663
|
+
</td><td>
|
|
664
|
+
<p class="simpara">Yes</p>
|
|
665
|
+
</td></tr><tr><td>
|
|
666
|
+
<p class="simpara"> One of the following elements: </p>
|
|
667
|
+
</td><td> </td><td>
|
|
668
|
+
<p class="simpara">Yes</p>
|
|
669
|
+
</td></tr><tr><td>
|
|
670
|
+
<p class="simpara">
|
|
671
|
+
<em class="parameter"><code>Text</code></em>
|
|
672
|
+
</p>
|
|
673
|
+
</td><td>
|
|
674
|
+
<p class="simpara">Contains the content of the selected item.</p>
|
|
675
|
+
<p class="simpara">Type: String</p>
|
|
676
|
+
<p class="simpara">Default: None</p>
|
|
677
|
+
</td><td class="auto-generated"> </td></tr><tr><td>
|
|
678
|
+
<p class="simpara">
|
|
679
|
+
<em class="parameter"><code>FormattedContent</code></em>
|
|
680
|
+
</p>
|
|
681
|
+
</td><td>
|
|
682
|
+
<p class="simpara"> A block of text formatted using XHTML tags that contains the content
|
|
683
|
+
of the selected item. For more information about this format, see <a class="link" href="ApiReference_FormattedContentXHTMLArticle.html" title="Formatted Content: XHTML">Formatted Content: XHTML</a>. </p>
|
|
684
|
+
<p class="simpara">Type: String</p>
|
|
685
|
+
<p class="simpara">Default: None</p>
|
|
686
|
+
</td><td class="auto-generated"> </td></tr><tr><td>
|
|
687
|
+
<p class="simpara">
|
|
688
|
+
<em class="parameter"><code>Binary</code></em>
|
|
689
|
+
</p>
|
|
690
|
+
</td><td>
|
|
691
|
+
<p class="simpara">Contains the content of the selected item.</p>
|
|
692
|
+
<p class="simpara">Type: <em class="parameter"><code>Binary</code></em></p>
|
|
693
|
+
<p class="simpara">Default: None</p>
|
|
694
|
+
</td><td class="auto-generated"> </td></tr></tbody></table></div><p> The following example shows a <em class="parameter"><code>SelectionAnswer</code></em> element that specifies
|
|
695
|
+
a question with four radiobuttons. </p><pre class="programlisting"><SelectionAnswer>
|
|
696
|
+
<StyleSuggestion>radiobutton</StyleSuggestion>
|
|
697
|
+
<Selections>
|
|
698
|
+
<Selection>
|
|
699
|
+
<SelectionIdentifier>C1</SelectionIdentifier>
|
|
700
|
+
<Text>C1 (northeast)</Text>
|
|
701
|
+
</Selection>
|
|
702
|
+
<Selection>
|
|
703
|
+
<SelectionIdentifier>C2</SelectionIdentifier>
|
|
704
|
+
<Text>C2 (east)</Text>
|
|
705
|
+
</Selection>
|
|
706
|
+
<Selection>
|
|
707
|
+
<SelectionIdentifier>A3</SelectionIdentifier>
|
|
708
|
+
<Text>A3 (southwest)</Text>
|
|
709
|
+
</Selection>
|
|
710
|
+
<Selection>
|
|
711
|
+
<SelectionIdentifier>C3</SelectionIdentifier>
|
|
712
|
+
<Text>C3 (southeast)</Text>
|
|
713
|
+
</Selection>
|
|
714
|
+
</Selections>
|
|
715
|
+
</SelectionAnswer></pre></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title" id="d0e18932">FileUploadAnswer</h3></div></div></div><a class="indexterm" name="d0e18935"></a><a class="indexterm" name="d0e18938"></a><p> A <em class="parameter"><code>FileUploadAnswer</code></em> prompts the Worker to upload a file as the answer
|
|
716
|
+
to the question. When the Worker uploads the file, Amazon Mechanical Turk stores the file
|
|
717
|
+
separately from the answer data. Once the HIT is submitted, your application can call the
|
|
718
|
+
<code class="function">GetFileUploadURL</code> operation to get a temporary URL it can use to
|
|
719
|
+
download the file. </p><p> The <em class="parameter"><code>FileUploadAnswer</code></em> specification contains two required elements, a
|
|
720
|
+
<em class="parameter"><code>MinFileSizeInBytes</code></em> and a <em class="parameter"><code>MaxFileSizeInBytes</code></em>,
|
|
721
|
+
that specify the minimum and maximum allowed file sizes respectively. If the Worker uploads a
|
|
722
|
+
file whose size in bytes is outside of this range, the answer is rejected, and the Worker must
|
|
723
|
+
upload a different file to complete the HIT. You can specify a maximum size up to 2000000000
|
|
724
|
+
(2 billion) bytes. </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p class="simpara"> A <em class="parameter"><code>FileUploadAnswer</code></em> element can only be used with HITs. It
|
|
725
|
+
cannot be used with Qualification tests. </p></td></tr></table></div><p> The following example demonstrates a <em class="parameter"><code>FileUploadAnswer</code></em> element that
|
|
726
|
+
specifies a file with a minimum of 1000 bytes and a maximum of 3000000 bytes. </p><pre class="programlisting"><FileUploadAnswer>
|
|
727
|
+
<MaxFileSizeInBytes>3000000</MaxFileSizeInBytes>
|
|
728
|
+
<MinFileSizeInBytes>1000</MinFileSizeInBytes>
|
|
729
|
+
</FileUploadAnswer></pre></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both" id="d0e18973">Example</h2></div></div></div><p> The following is an example of a complete <em class="parameter"><code>QuestionForm</code></em> data structure.
|
|
730
|
+
Remember that to pass this structure in as a value of a parameter to an operation, XML characters
|
|
731
|
+
must be escaped as character entities. (See <a class="link" href="ApiReference_XMLParameterValuesArticle.html" title="Using XML Parameter Values">Using XML Parameter Values</a> for more information.) </p><pre class="programlisting"><QuestionForm xmlns="<em class="replaceable"><code>[the QuestionForm schema URL]</code></em>">
|
|
732
|
+
<Overview>
|
|
733
|
+
<Title>Game 01523, "X" to play</Title>
|
|
734
|
+
<Text>
|
|
735
|
+
You are helping to decide the next move in a game of Tic-Tac-Toe. The board looks like this:
|
|
736
|
+
</Text>
|
|
737
|
+
<Binary>
|
|
738
|
+
<MimeType>
|
|
739
|
+
<Type>image</Type>
|
|
740
|
+
<SubType>gif</SubType>
|
|
741
|
+
</MimeType>
|
|
742
|
+
<DataURL>http://tictactoe.amazon.com/game/01523/board.gif</DataURL>
|
|
743
|
+
<AltText>The game board, with "X" to move.</AltText>
|
|
744
|
+
</Binary>
|
|
745
|
+
<Text>
|
|
746
|
+
Player "X" has the next move.
|
|
747
|
+
</Text>
|
|
748
|
+
</Overview>
|
|
749
|
+
<Question>
|
|
750
|
+
<QuestionIdentifier>nextmove</QuestionIdentifier>
|
|
751
|
+
<DisplayName>The Next Move</DisplayName>
|
|
752
|
+
<IsRequired>true</IsRequired>
|
|
753
|
+
<QuestionContent>
|
|
754
|
+
<Text>
|
|
755
|
+
What are the coordinates of the best move for player "X" in this game?
|
|
756
|
+
</Text>
|
|
757
|
+
</QuestionContent>
|
|
758
|
+
<AnswerSpecification>
|
|
759
|
+
<FreeTextAnswer>
|
|
760
|
+
<Constraints>
|
|
761
|
+
<Length minLength="2" maxLength="2" />
|
|
762
|
+
</Constraints>
|
|
763
|
+
<DefaultText>C1</DefaultText>
|
|
764
|
+
</FreeTextAnswer>
|
|
765
|
+
</AnswerSpecification>
|
|
766
|
+
</Question>
|
|
767
|
+
<Question>
|
|
768
|
+
<QuestionIdentifier>likelytowin</QuestionIdentifier>
|
|
769
|
+
<DisplayName>The Next Move</DisplayName>
|
|
770
|
+
<IsRequired>true</IsRequired>
|
|
771
|
+
<QuestionContent>
|
|
772
|
+
<Text>
|
|
773
|
+
How likely is it that player "X" will win this game?
|
|
774
|
+
</Text>
|
|
775
|
+
</QuestionContent>
|
|
776
|
+
<AnswerSpecification>
|
|
777
|
+
<SelectionAnswer>
|
|
778
|
+
<StyleSuggestion>radiobutton</StyleSuggestion>
|
|
779
|
+
<Selections>
|
|
780
|
+
<Selection>
|
|
781
|
+
<SelectionIdentifier>notlikely</SelectionIdentifier>
|
|
782
|
+
<Text>Not likely</Text>
|
|
783
|
+
</Selection>
|
|
784
|
+
<Selection>
|
|
785
|
+
<SelectionIdentifier>unsure</SelectionIdentifier>
|
|
786
|
+
<Text>It could go either way</Text>
|
|
787
|
+
</Selection>
|
|
788
|
+
<Selection>
|
|
789
|
+
<SelectionIdentifier>likely</SelectionIdentifier>
|
|
790
|
+
<Text>Likely</Text>
|
|
791
|
+
</Selection>
|
|
792
|
+
</Selections>
|
|
793
|
+
</SelectionAnswer>
|
|
794
|
+
</AnswerSpecification>
|
|
795
|
+
</Question>
|
|
796
|
+
</QuestionForm></pre></div></div><div class="navfooter"><table width="100%" summary="Navigation footer" cellspacing="0" cellpadding="2"><tr><td width="30%" align="left"><a accesskey="p" href="ApiReference_XMLParameterValuesArticle.html"><img src="images/prev.gif" alt="Prev"></a> </td><td width="40%" align="center"><a href="http://survey.amazonwebservices.com/survey/s?s=559&opdata_page=Mturk_API_2008-08-02_ApiReference_QuestionFormDataStructureArticle">Documentation Feedback</a><br><a href="copyrightinfo.html">Copyright Information</a></td><td width="30%" align="right"> <a accesskey="n" href="ApiReference_FormattedContentXHTMLArticle.html"><img src="images/next.gif" alt="Next"></a></td></tr><tr><td width="30%" align="left" valign="top"> </td><td width="40%" align="center"><a accesskey="h" href="#top"><img src="images/home.gif" alt="Home"></a></td><td width="30%" align="right" valign="top"> </td></tr></table></div></body></html>
|