Description Usage Arguments Details Value Author(s) References See Also Examples
Generate an AnswerKey data structure for a Qualification test.
1 2 | GenerateAnswerKey(questions, scoring = NULL)
AnswerKeyTemplate(xml.parsed = NULL)
|
questions |
A data frame containing QuestionIdentifiers, AnswerOptions, AnswerScores, and DefaultScores. See MTurk API Documentation. |
scoring |
An optional list containing QualificationValueMapping information. See MTurk API Documentation. |
xml.parsed |
A complete QuestionForm data structure parsed by |
GenerateAnswerKey creates an AnswerKey data structure (possibly from a template created by AnswerKeyTemplate from a QuestionForm data structure), which serves to automatically score a Qualification test, as specified in the test
parameter of CreateQualificationType
. An AnswerKey data structure is also returned by GetQualificationType
.
GenerateAnswerKey returns a list containing an AnswerKey data structure as a parsed XML tree, character string containing that tree, and a url-encoded character string.
AnswerKeyTemplate returns a list that can be used in the questions
parameter of GenerateAnswerKey. Placeholders are left for AnswerScore values to be manually entered prior to using it in GenerateAnswerKey.
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:
# generate an AnswerKey from a list of arguments
qs <- list(list(QuestionIdentifier = "Question1",
AnswerOption = list(SelectionIdentifier="A", AnswerScore=15),
AnswerOption = list(SelectionIdentifier="B", AnswerScore=10),
DefaultScore = 5),
list(QuestionIdentifier = "Question2",
AnswerOption = list(SelectionIdentifier="D", AnswerScore=10) ) )
scoring1 <- list(PercentageMapping=5)
scoring2 <- list(RangeMapping=list(list(InclusiveLowerBound=0,
InclusiveUpperBound=20,
QualificationValue=5),
list(InclusiveLowerBound=21,
InclusiveUpperBound=100,
QualificationValue=10)),
OutOfRangeQualificationValue=0)
ak1 <- GenerateAnswerKey(qs, scoring1)
ak2 <- GenerateAnswerKey(qs, scoring2)
# generate an AnswerKey template from a QualificationTest
qt <- system.file("templates", "qualificationtest1.xml", package = "MTurkR")
akt <- AnswerKeyTemplate(xmlParse(qt))
# use the template to generate an AnswerKey
ak <- GenerateAnswerKey(ak)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.