Description Usage Arguments Details Value Author(s) References See Also Examples
Generate a HITLayout parameter based upon the names of HIT template variables and the values to substitute for those variables in a single HIT. Used in collaboration with a HIT Layout ID from https://requester.mturk.com/create/projects in the CreateHIT
operation.
1 | GenerateHITLayoutParameter(names, values)
|
names |
A character string containing the name of a HIT template variable or a vector of character strings containing the names of multiple HIT template variables. This is optional if |
values |
A character string containing the value of a HIT template variable to be inserted for a specific HIT or a vector of character strings containing the values of multiple HIT template variables to be inserted for a specific HIT. If |
This function provides the content for the hitlayoutparameters
option of CreateHIT
. Specifically, a HIT Template created in the MTurk Requester User Interface (RUI) has a number of placeholder variables for content to be inserted. This fucntion supplies the content to be inserted into the template for one HIT. If multiple HITs are being created from one template, then GenerateHITLayoutParameter
should be run once for each HIT.
Analogous functionality for producing .html files on the local workstation (e.g., to create multiple external HITs from the same template) is provided by GenerateHITsFromTemplate
.
A character string containing URL query parameter-formatted HITLayout parameters, to be used in the hitlayoutparameters
parameter of CreateHIT
.
Thomas J. Leeper
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | ## Not run:
# examples of specifying 'names' and 'values'
a <- GenerateHITLayoutParameter(names = "hitvariable",
values = "Text for HIT 1")
b <- GenerateHITLayoutParameter(names = "hitvariable",
values = "Text for HIT 2")
c <- GenerateHITLayoutParameter(names = c("hitvariable1","hitvariable2"),
values = c("Headline for HIT1","Text for HIT 1"))
# example using a named character string in lieu of specifying 'names'
d <- GenerateHITLayoutParameter(values = c(hitvariable1 = "Headline for HIT1",
hitvariable2 = "Text for HIT 1"))
# create HIT using layout parameter
hit1 <-
CreateHIT(title = "Survey",
description = "5 question survey",
reward = ".10",
expiration = seconds(days=4),
duration = seconds(hours = 1),
keywords = "survey, questionnaire",
# retrieved from MTurk web interface:
hitlayoutid = "23ZGOOGQSCM61T1H5H9U0U00OQWFFU",
hitlayoutparameters = a)
# cleanup
DisableHIT(hit1$HITId)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.