-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhit_type_registration2.php
36 lines (31 loc) · 1.27 KB
/
hit_type_registration2.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
require_once(__DIR__.'/Turk50/Turk50.php');
include(__DIR__.'/aws-credentials.php');
// Creates a HitType and prints new ID
// require Worker_PercentAssignmentsApproved >= 90%
$Worker_PercentAssignmentsApproved = array(
"QualificationTypeId" => "000000000000000000L0",
"Comparator" => "GreaterThanOrEqualTo",
"IntegerValue" => "90"
);
//prepare Request
$Request = array(
"Title" => "Review Forum Comments",
"Description" => "Review a comment for a forum thread",
"Reward" => array("Amount" => "0.25", "CurrencyCode" => "USD"),
"AssignmentDurationInSeconds" => "30",
"LifetimeInSeconds" => "7200",
"AutoApprovalDelayInSeconds" => "1200",
"QualificationRequirement" => $Worker_PercentAssignmentsApproved
);
// invoke CreateHIT
$RegResponse = $turk50->RegisterHITType($Request);
if ($RegResponse->RegisterHITTypeResult){
echo "<h1>This is your new HIT Type Id:</h1>";
print($RegResponse->RegisterHITTypeResult->HITTypeId);
}
else{
echo "You requested failed please see detailed response below<br />";
print_r($RegResponse);
}
?>