Skip to content
This repository was archived by the owner on May 24, 2019. It is now read-only.

Commit f3b71a7

Browse files
committed
bump version
1 parent d75e809 commit f3b71a7

File tree

6 files changed

+66
-44
lines changed

6 files changed

+66
-44
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: MTurkR
2-
Version: 0.5.65
3-
Date: 2015-01-04
2+
Version: 0.6
3+
Date: 2015-01-07
44
Title: R Client for the MTurk Requester API
55
Authors@R: c(person("Thomas J.", "Leeper", role = c("aut", "cre"),
66
email = "[email protected]"),

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
## DOCUMENTATION ##
1515

16+
* Documentation for `CreateHIT` and `CreateQualificationType` now include examples using template files installed with the package. (#40)
1617
* Documentation of generating a Masters QualificationRequirement has been slightly clarified.
1718
* Examples of Amazon Simple Queue Service (SQS) notifications have been added, along with a detailed tutorial on the MTurk wiki. (#60)
1819

inst/templates/htmlquestion1.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
<HTMLQuestion xmlns="[the HTMLQuestion schema URL]">
2-
<HTMLContent><![CDATA[
31
<!DOCTYPE html>
42
<html>
53
<head>
@@ -15,7 +13,3 @@
1513
<script language='Javascript'>turkSetAssignmentID();</script>
1614
</body>
1715
</html>
18-
]]>
19-
</HTMLContent>
20-
<FrameHeight>450</FrameHeight>
21-
</HTMLQuestion>

man/CreateHIT.Rd

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -69,34 +69,56 @@ When creating a ExternalQuestion HITs, the \code{\link{GenerateHITsFromTemplate}
6969
}
7070
\examples{
7171
\dontrun{
72+
## CreateHIT using HITLayout from MTurk Requester User Interface ##
7273
a <- GenerateLayoutParameter("message","Text to display in HIT")
73-
hit1 <-
74-
CreateHIT(hit.type = "2FFNCWYB49F9BBJWA4SJUNST5OFSOW",
75-
hitlayoutid = "23ZGOOGQSCM61T1H5H9U0U00OQWFFU",
76-
expiration = seconds(days = 4),
77-
hitlayoutparameters = a)
78-
79-
b <- GenerateExternalQuestion("https://www.example.com/","400")
80-
hit2 <-
81-
CreateHIT(hit.type = "2FFNCWYB49F9BBJWA4SJUNST5OFSOW",
82-
expiration = seconds(days = 4),
83-
question = b$string)
84-
85-
hit3 <-
86-
CreateHIT(title = "Survey",
87-
description = "5 question survey",
88-
reward = ".10",
89-
expiration = seconds(days = 4),
90-
duration = seconds(hours = 1),
91-
keywords = "survey, questionnaire",
92-
question = b$string)
74+
hit1 <- CreateHIT(hit.type = "2FFNCWYB49F9BBJWA4SJUNST5OFSOW",
75+
hitlayoutid = "23ZGOOGQSCM61T1H5H9U0U00OQWFFU",
76+
expiration = seconds(days = 4),
77+
hitlayoutparameters = a)
9378

79+
## CreateHIT using ExternalQuestion HIT URL ##
80+
eq <- GenerateExternalQuestion("https://www.example.com/","400")
81+
82+
### Specifying a HITTypeId ###
83+
hit2 <- CreateHIT(hit.type = "2FFNCWYB49F9BBJWA4SJUNST5OFSOW",
84+
expiration = seconds(days = 4),
85+
question = eq$string)
86+
87+
### Creating a new HITTypeId atomically ###
88+
hit3 <- CreateHIT(title = "Survey",
89+
description = "5 question survey",
90+
reward = ".10",
91+
expiration = seconds(days = 4),
92+
duration = seconds(hours = 1),
93+
keywords = "survey, questionnaire",
94+
question = eq$string)
95+
96+
## CreateHIT using HTMLQuestion HIT Contents ##
97+
f1 <- system.file("templates/htmlquestion1.xml", package = "MTurkR")
98+
hq <- GenerateHTMLQuestion(file = f1)
99+
hit4 <- CreateHIT(hit.type = "2FFNCWYB49F9BBJWA4SJUNST5OFSOW",
100+
expiration = seconds(days = 4),
101+
question = hq$string)
102+
103+
## CreateHIT using QuestionForm HIT Contents ##
104+
f2 <- system.file("templates/tictactoe.xml", package = "MTurkR")
105+
qf <- GenerateHTMLQuestion(file = f2)
106+
hit5 <- CreateHIT(hit.type = "2FFNCWYB49F9BBJWA4SJUNST5OFSOW",
107+
expiration = seconds(days = 4),
108+
question = qf$string)
109+
110+
111+
## Cleanup examples ##
94112
ExpireHIT(hit1$HITId)
95113
ExpireHIT(hit2$HITId)
96114
ExpireHIT(hit3$HITId)
115+
ExpireHIT(hit4$HITId)
116+
ExpireHIT(hit5$HITId)
97117
DisposeHIT(hit1$HITId)
98118
DisposeHIT(hit2$HITId)
99119
DisposeHIT(hit3$HITId)
120+
DisposeHIT(hit4$HITId)
121+
DisposeHIT(hit5$HITId)
100122
}
101123
}
102124
\keyword{HITs}

man/CreateQualificationType.Rd

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,24 @@ A function to create a QualificationType. Active QualificationTypes are visible
4949
}
5050
\examples{
5151
\dontrun{
52-
qual1 <-
53-
CreateQualificationType(name="Worked for me before",
54-
description="This qualification is for people who have worked for me before",
55-
status = "Active",
56-
keywords="Worked for me before")
52+
# Create
53+
qual1 <- CreateQualificationType(name="Worked for me before",
54+
description="This qualification is for people who have worked for me before",
55+
status = "Active",
56+
keywords="Worked for me before")
5757
DisposeQualificationType(qual1$QualificationTypeId)
5858
}
5959

6060
\dontrun{
61-
# qualification with test and answer key
62-
qual1 <-
63-
CreateQualificationType(name="Worked for me before",
64-
description="This qualification is for people who have worked for me before",
65-
test = paste0(readLines(system.file("qualificationtest1.xml", package = "MTurkR")), collapse="")
66-
answerkey = paste0(readLines(system.file("answerkey1.xml", package = "MTurkR")), collapse="")
67-
status = "Active",
68-
keywords="Worked for me before")
61+
# QualificationType with test and answer key
62+
qf <- paste0(readLines(system.file("qualificationtest1.xml", package = "MTurkR")), collapse="")
63+
qa <- paste0(readLines(system.file("answerkey1.xml", package = "MTurkR")), collapse="")
64+
qual1 <- CreateQualificationType(name = "Qualification with Test",
65+
description = "This qualification is a demo",
66+
test = qf,
67+
answerkey = qa, # optionally, use AnswerKey
68+
status = "Active",
69+
keywords = "test, autogranted")
6970
DisposeQualificationType(qual1$QualificationTypeId)
7071
}
7172

man/GenerateHTMLQuestion.Rd

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ GenerateHTMLQuestion(character = NULL, file = NULL, frame.height = 450)
1010
\item{file}{An optional character string containing a filename from which to construct the HTMLQuestion data structure.}
1111
\item{frame.height}{A character string containing the integer value (in pixels) of the frame height for the HTMLQuestion iframe.}
1212
}
13-
\details{Must specify either \code{character} or \code{file}.}
13+
\details{
14+
Must specify either \code{character} or \code{file}.
15+
16+
To be valid, an HTMLQuestion data structure must be a complete XHTML document, including doctype declaration, head and body tags, and a complete HTML form (including the \code{form} tag with a submit URL, the assignmentId for the assignment as a form field, at least one substantive form field (can be hidden), and a submit button that posts to the external submit URL; see \code{\link{GenerateExternalQuestion}}.). If you fail to include a complete \code{form}, workers will be unable to submit the HIT. See the API Documentation for a complete example.}
1417
\value{A list containing \code{xml.parsed}, an XML data structure, \code{string}, xml formatted as a character string, and \code{url.encoded}, character string containing a URL query parameter-formatted HTMLQuestion data structure for use in the \code{question} parameter of \code{\link{CreateHIT}}.}
1518
\references{
1619
\href{http://docs.amazonwebservices.com/AWSMechTurk/latest/AWSMturkAPI/ApiReference_HTMLQuestionArticle.html}{API Reference}
@@ -26,7 +29,8 @@ GenerateHTMLQuestion(character = NULL, file = NULL, frame.height = 450)
2629
}
2730
\examples{
2831
\dontrun{
29-
a <- GenerateHTMLQuestion(file="mynewhit.html")
32+
f <- system.file("templates/htmlquestion1.xml", package = "MTurkR")
33+
a <- GenerateHTMLQuestion(file=f)
3034

3135
hit1 <-
3236
CreateHIT(title = "Survey",
@@ -41,4 +45,4 @@ ExpireHIT(hit1$HITId)
4145
DisposeHIT(hit1$HITId)
4246
}
4347
}
44-
\keyword{HITs}
48+
\keyword{HITs}

0 commit comments

Comments
 (0)