@@ -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 ##
7273a <- 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 ##
94112ExpireHIT(hit1 $ HITId )
95113ExpireHIT(hit2 $ HITId )
96114ExpireHIT(hit3 $ HITId )
115+ ExpireHIT(hit4 $ HITId )
116+ ExpireHIT(hit5 $ HITId )
97117DisposeHIT(hit1 $ HITId )
98118DisposeHIT(hit2 $ HITId )
99119DisposeHIT(hit3 $ HITId )
120+ DisposeHIT(hit4 $ HITId )
121+ DisposeHIT(hit5 $ HITId )
100122}
101123}
102124\keyword {HITs }
0 commit comments