jeudi 22 mai 2014

HTML5 - créer MTurk frappé en R en utilisant le CreateHTMLQuestion Commmand - Stack Overflow


I would like to Create a Mechanical Turk Hit by using the MTurK Package in R. The R code I am using is the following:


filecontent <- GenerateHTMLQuestion(file="file.html")
print(filecontent)
#filestring <- filecontent [["string"]]
#filestring <- filecontent [["xml.parsed"]]
#filestring <- filecontent [["url.encoded"]]
filecontentForQuestion <- filecontent$string
filecontentForQuestion <- filecontent$xml
filecontentForQuestion <- filecontent$url
print(filecontentForQuestion)
testhit<-CreateHIT(question=filecontentForQuestion,
title="Title",
description="Description",
keywords="Keyword",
reward="0.05",
assignments="3",
duration="3600",
expiration="20000",
auto.approval.delay="2590000",
qual.req=GenerateQualificationRequirement("Approved",">","5"),
browser = F,
sandbox=T)

I have tried every different filecontent, but I always get an error when I use this command. Unfortunately, I always get the following error:


Error (AWS.MechanicalTurk.HTML5ParseError): There was an error parsing the
HTML5 data in your request. Please make sure the data is
well-formed and validates as HTML5

However, the html file I am using is the one from the MTurk API Manual and is the following:


<!DOCTYPE html>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/>
<script type='text/javascript' src='https://s3.amazonaws.com/mturk-public/ex
ternalHIT_v1.js'></script>
</head>
<body>
<form name='mturk_form' method='post' id='mturk_form' action='ht
tps://www.mturk.com/mturk/externalSubmit'>
<input type='hidden' value='' name='assignmentId' id='assignmentId'/>
<h1>What's up?</h1>
<p><textarea name='comment' cols='80' rows='3'></textarea></p>
<p><input type='submit' id='submitButton' value='Submit' /></p></form>
<script language='Javascript'>turkSetAssignmentID();</script>
</body>
</html>

I get the same error if I use a complete empty html5 doc with only the necessary placeholders. Has anyone an idea, why this does not work?


Using the hitlayoutid parameters or ExternalQuestion commands work, so I would like to explicitly use the GenerateHTMLQuestion command.


Any help would be appreciated very much.



I would like to Create a Mechanical Turk Hit by using the MTurK Package in R. The R code I am using is the following:


filecontent <- GenerateHTMLQuestion(file="file.html")
print(filecontent)
#filestring <- filecontent [["string"]]
#filestring <- filecontent [["xml.parsed"]]
#filestring <- filecontent [["url.encoded"]]
filecontentForQuestion <- filecontent$string
filecontentForQuestion <- filecontent$xml
filecontentForQuestion <- filecontent$url
print(filecontentForQuestion)
testhit<-CreateHIT(question=filecontentForQuestion,
title="Title",
description="Description",
keywords="Keyword",
reward="0.05",
assignments="3",
duration="3600",
expiration="20000",
auto.approval.delay="2590000",
qual.req=GenerateQualificationRequirement("Approved",">","5"),
browser = F,
sandbox=T)

I have tried every different filecontent, but I always get an error when I use this command. Unfortunately, I always get the following error:


Error (AWS.MechanicalTurk.HTML5ParseError): There was an error parsing the
HTML5 data in your request. Please make sure the data is
well-formed and validates as HTML5

However, the html file I am using is the one from the MTurk API Manual and is the following:


<!DOCTYPE html>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/>
<script type='text/javascript' src='https://s3.amazonaws.com/mturk-public/ex
ternalHIT_v1.js'></script>
</head>
<body>
<form name='mturk_form' method='post' id='mturk_form' action='ht
tps://www.mturk.com/mturk/externalSubmit'>
<input type='hidden' value='' name='assignmentId' id='assignmentId'/>
<h1>What's up?</h1>
<p><textarea name='comment' cols='80' rows='3'></textarea></p>
<p><input type='submit' id='submitButton' value='Submit' /></p></form>
<script language='Javascript'>turkSetAssignmentID();</script>
</body>
</html>

I get the same error if I use a complete empty html5 doc with only the necessary placeholders. Has anyone an idea, why this does not work?


Using the hitlayoutid parameters or ExternalQuestion commands work, so I would like to explicitly use the GenerateHTMLQuestion command.


Any help would be appreciated very much.


0 commentaires:

Enregistrer un commentaire