Learn R Programming

MTurkR (version 0.2)

ApproveAssignment: Approve Assignment(s)

Description

Approve one or more submitted assignments, or approve all assignments for a given HIT or HITType. Also allows you to approve a previously rejected assignment. This function spends money from your MTurk account.

Usage

ApproveAssignment(	assignments, feedback = NULL, rejected = FALSE, 
					keypair = credentials(), print = FALSE, browser = FALSE, 
					log.requests = TRUE, sandbox = FALSE)

ApproveAllAssignments(	hit = NULL, hit.type = NULL, feedback = NULL, 
						keypair = credentials(), print = FALSE, 
						log.requests = TRUE, sandbox = FALSE)

Arguments

assignments
A character string containing an AssignmentId, or a vector of multiple character strings containing multiple AssignmentIds, to approve.
hit
A character string containing a HITId all of whom's assignments are to be approved.
hit.type
A character string containing a HITTypeId all of whom's HITs' assignments are to be approved.
feedback
An optional character string containing any feedback for a worker. This must have length 1 or length equal to the number of workers. Maximum of 1024 characters. For ApproveAllAssignments, must be length 1.
rejected
A logical indicating whether the assignment(s) had previously been rejected (default FALSE). Approval of previously rejected assignments must be conducted separately from other approvals.
keypair
A two-item character vector containing an AWS Access Key ID in the first position and the corresponding Secret Access Key in the second position. Set default with credentials.
print
Optionally print the results of the API request to the standard output. Default is TRUE.
browser
Optionally open the request in the default web browser, rather than opening in R. Default is FALSE.
log.requests
A logical specifying whether API requests should be logged. Default is TRUE. See readlogfile for details.
sandbox
Optionally execute the request in the MTurk sandbox rather than the live server. Default is FALSE.

Value

  • A dataframe containing the list of AssignmentIds, feedback (if any), and whether or not each approval request was valid.

Details

Approve assignments, by AssignmentId (as returned by GetAssignment or by HITId or HITTypeId. Must specify assignments xor hit xor hit.type. ApproveAllAssignments approves all assignments of a given HIT or HITType without first having to perform GetAssignment. ApproveAssignments() and approve() are aliases for ApproveAssignment. approveall() is an alias for ApproveAllAssignments.

References

http://docs.amazonwebservices.com/AWSMechTurk/latest/AWSMturkAPI/ApiReference_ApproveAssignmentOperation.html{API Reference: Approve Assignment} http://docs.amazonwebservices.com/AWSMechTurk/latest/AWSMturkAPI/ApiReference_ApproveRejectedAssignmentOperation.html{API Reference: Approve Rejected Assignment}

See Also

RejectAssignment

Examples

Run this code
a <- ApproveAssignment(assignments="26XXH0JPPSI23H54YVG7BKLEXAMPLE")

b <- ApproveAssignment(
assignments=c("26XXH0JPPSI23H54YVG7BKLEXAMPLE1","26XXH0JPPSI23H54YVG7BKLEXAMPLE2"),
feedback="Great work!")

c <- ApproveAllAssignments(hit="2MQB727M0IGF304GJ16S1F4VE3AYDQ")

d <- ApproveAllAssignments(hit.type="2FFNCWYB49F9BBJWA4SJUNST5OFSOW")

Run the code above in your browser using DataLab