Learn R Programming

MTurkR (version 0.5.1)

GenerateHITLayoutParameter: Generate a HITLayout Parameter

Description

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 (https://requester.mturk.com/hit_templates) in the CreateHIT operation.

Usage

GenerateHITLayoutParameter(names, values)

Arguments

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

Value

  • A character string containing URL query parameter-formatted HITLayout parameters, to be used in the hitlayoutparameters parameter of CreateHIT.

Details

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.

References

http://docs.amazonwebservices.com/AWSMechTurk/latest/AWSMturkAPI/ApiReference_HITLayoutArticle.html{API Reference}

See Also

CreateHIT GenerateExternalQuestion GenerateHITsFromTemplate

Examples

Run this code
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"))

Run the code above in your browser using DataLab