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

Commit

Permalink
bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
leeper committed Jan 7, 2015
1 parent d75e809 commit f3b71a7
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 44 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: MTurkR
Version: 0.5.65
Date: 2015-01-04
Version: 0.6
Date: 2015-01-07
Title: R Client for the MTurk Requester API
Authors@R: c(person("Thomas J.", "Leeper", role = c("aut", "cre"),
email = "thosjleeper@gmail.com"),
Expand Down
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

## DOCUMENTATION ##

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

Expand Down
6 changes: 0 additions & 6 deletions inst/templates/htmlquestion1.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<HTMLQuestion xmlns="[the HTMLQuestion schema URL]">
<HTMLContent><![CDATA[
<!DOCTYPE html>
<html>
<head>
Expand All @@ -15,7 +13,3 @@
<script language='Javascript'>turkSetAssignmentID();</script>
</body>
</html>
]]>
</HTMLContent>
<FrameHeight>450</FrameHeight>
</HTMLQuestion>
62 changes: 42 additions & 20 deletions man/CreateHIT.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -69,34 +69,56 @@ When creating a ExternalQuestion HITs, the \code{\link{GenerateHITsFromTemplate}
}
\examples{
\dontrun{
## CreateHIT using HITLayout from MTurk Requester User Interface ##
a <- GenerateLayoutParameter("message","Text to display in HIT")
hit1 <-
CreateHIT(hit.type = "2FFNCWYB49F9BBJWA4SJUNST5OFSOW",
hitlayoutid = "23ZGOOGQSCM61T1H5H9U0U00OQWFFU",
expiration = seconds(days = 4),
hitlayoutparameters = a)

b <- GenerateExternalQuestion("https://www.example.com/","400")
hit2 <-
CreateHIT(hit.type = "2FFNCWYB49F9BBJWA4SJUNST5OFSOW",
expiration = seconds(days = 4),
question = b$string)

hit3 <-
CreateHIT(title = "Survey",
description = "5 question survey",
reward = ".10",
expiration = seconds(days = 4),
duration = seconds(hours = 1),
keywords = "survey, questionnaire",
question = b$string)
hit1 <- CreateHIT(hit.type = "2FFNCWYB49F9BBJWA4SJUNST5OFSOW",
hitlayoutid = "23ZGOOGQSCM61T1H5H9U0U00OQWFFU",
expiration = seconds(days = 4),
hitlayoutparameters = a)

## CreateHIT using ExternalQuestion HIT URL ##
eq <- GenerateExternalQuestion("https://www.example.com/","400")

### Specifying a HITTypeId ###
hit2 <- CreateHIT(hit.type = "2FFNCWYB49F9BBJWA4SJUNST5OFSOW",
expiration = seconds(days = 4),
question = eq$string)

### Creating a new HITTypeId atomically ###
hit3 <- CreateHIT(title = "Survey",
description = "5 question survey",
reward = ".10",
expiration = seconds(days = 4),
duration = seconds(hours = 1),
keywords = "survey, questionnaire",
question = eq$string)

## CreateHIT using HTMLQuestion HIT Contents ##
f1 <- system.file("templates/htmlquestion1.xml", package = "MTurkR")
hq <- GenerateHTMLQuestion(file = f1)
hit4 <- CreateHIT(hit.type = "2FFNCWYB49F9BBJWA4SJUNST5OFSOW",
expiration = seconds(days = 4),
question = hq$string)

## CreateHIT using QuestionForm HIT Contents ##
f2 <- system.file("templates/tictactoe.xml", package = "MTurkR")
qf <- GenerateHTMLQuestion(file = f2)
hit5 <- CreateHIT(hit.type = "2FFNCWYB49F9BBJWA4SJUNST5OFSOW",
expiration = seconds(days = 4),
question = qf$string)


## Cleanup examples ##
ExpireHIT(hit1$HITId)
ExpireHIT(hit2$HITId)
ExpireHIT(hit3$HITId)
ExpireHIT(hit4$HITId)
ExpireHIT(hit5$HITId)
DisposeHIT(hit1$HITId)
DisposeHIT(hit2$HITId)
DisposeHIT(hit3$HITId)
DisposeHIT(hit4$HITId)
DisposeHIT(hit5$HITId)
}
}
\keyword{HITs}
27 changes: 14 additions & 13 deletions man/CreateQualificationType.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,24 @@ A function to create a QualificationType. Active QualificationTypes are visible
}
\examples{
\dontrun{
qual1 <-
CreateQualificationType(name="Worked for me before",
description="This qualification is for people who have worked for me before",
status = "Active",
keywords="Worked for me before")
# Create
qual1 <- CreateQualificationType(name="Worked for me before",
description="This qualification is for people who have worked for me before",
status = "Active",
keywords="Worked for me before")
DisposeQualificationType(qual1$QualificationTypeId)
}

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

Expand Down
10 changes: 7 additions & 3 deletions man/GenerateHTMLQuestion.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ GenerateHTMLQuestion(character = NULL, file = NULL, frame.height = 450)
\item{file}{An optional character string containing a filename from which to construct the HTMLQuestion data structure.}
\item{frame.height}{A character string containing the integer value (in pixels) of the frame height for the HTMLQuestion iframe.}
}
\details{Must specify either \code{character} or \code{file}.}
\details{
Must specify either \code{character} or \code{file}.

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.}
\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}}.}
\references{
\href{http://docs.amazonwebservices.com/AWSMechTurk/latest/AWSMturkAPI/ApiReference_HTMLQuestionArticle.html}{API Reference}
Expand All @@ -26,7 +29,8 @@ GenerateHTMLQuestion(character = NULL, file = NULL, frame.height = 450)
}
\examples{
\dontrun{
a <- GenerateHTMLQuestion(file="mynewhit.html")
f <- system.file("templates/htmlquestion1.xml", package = "MTurkR")
a <- GenerateHTMLQuestion(file=f)

hit1 <-
CreateHIT(title = "Survey",
Expand All @@ -41,4 +45,4 @@ ExpireHIT(hit1$HITId)
DisposeHIT(hit1$HITId)
}
}
\keyword{HITs}
\keyword{HITs}

0 comments on commit f3b71a7

Please sign in to comment.