jefftimesten/mturk — pull request #18 by dparise (2014-02-13 17:00:32+00:00)
Title: added HITLayoutId as options for creating HIT

Added HITLayouts and HITLayoutParameters to createHIT(). Also updated README with corresponding information.

Layout made on requester page, used to test:
<h1>${param1}</h1>
<input name="${param2}" required="" type="text" />

Corresponding function call:
mturk.RegisterHITType(RegisterHITTypeOptions, function(err, HITTypeId){
if (err) throw err;
console.log("Registered HIT type "+HITTypeId);
var CreateHITOptions = {
'HITTypeId': HITTypeId
, 'HITLayoutId': '2UYP8PJWKUDJBZ4G4VU920B6UVFJ8X'
, 'LifetimeInSeconds': 60 * 20
, 'HITLayoutParameters': {
param1:'foo',
param2:'bar'
}
};
mturk.CreateHIT(CreateHITOptions, function(err, HITId){
if (err) throw err;
console.log("Created HIT "+HITId);
});
});