GenerateExternalQuestion: Generate ExternalQuestion

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Generate an ExternalQuestion data structure for use in the ‘Question’ parameter of the CreateHIT operation.

Usage

1
GenerateExternalQuestion(url, frame.height = 400)

Arguments

url

A character string containing the URL (served over HTTPS) of a HIT file stored anywhere other than the MTurk server.

frame.height

A character string containing the integer value (in pixels) of the frame height for the ExternalQuestion iframe.

Details

An ExternalQuestion is a HIT stored anywhere other than the MTurk server that is displayed to workers within an HTML iframe of the specified height. The URL should point to a page — likely an HTML form — that can retrieve several URL GET parameters for “AssignmentId” and “WorkerId”, which are attached by MTurk when opening the URL. The page should also be able to submit those parameters plus any assignment data to https://www.mturk.com/mturk/externalSubmit (for the live MTurk site) or https://workersandbox.mturk.com/mturk/externalSubmit (for the sandbox site), using either the HTTP GET or POST methods.

Note: url must be HTTPS. See Wikipedia:HTTP Secure for details.

Value

A list containing xml.parsed, an XML data structure, string, xml formatted as a character string, and url.encoded, character string containing a URL query parameter-formatted HTMLQuestion data structure for use in the question parameter of CreateHIT.

Author(s)

Thomas J. Leeper

References

API Reference

See Also

CreateHIT

GenerateHITLayoutParameter

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
a <- GenerateExternalQuestion(url="http://www.example.com/", frame.height="400")

hit1 <- 
CreateHIT(title = "Survey",
          description = "5 question survey",
          reward = ".10",
          expiration = seconds(days = 4),
          duration = seconds(hours = 1),
          keywords = "survey, questionnaire",
          question = a$string)

ExpireHIT(hit1$HITId)
DisposeHIT(hit1$HITId)

## End(Not run)

leeper/MTurkR documentation built on June 6, 2019, 7:38 a.m.