/// <summary> /// The GetAssignmentsForHIT operation retrieves completed assignments for a HIT. /// You can use this operation to retrieve the results for a HIT. /// </summary> /// <param name="request">A <see cref="GetAssignmentsForHITRequest"/> instance containing /// the request parameters</param> /// <returns> /// A <see cref="GetAssignmentsForHITResult"/> instance /// </returns> /// <remarks> You can get assignments for a HIT at any time, even if the HIT is not /// yet "reviewable". If a HIT requested multiple assignments, and has received some /// results but has not yet become "reviewable", you can still retrieve the partial /// results with GetAssignmentsForHIT.</remarks> public GetAssignmentsForHITResult GetAssignmentsForHIT(GetAssignmentsForHITRequest request) { GetAssignmentsForHITResponse response = (GetAssignmentsForHITResponse)(this.SendRequest(request)); return response.GetAssignmentsForHITResult[0]; }
public static Assignment[] GetAssignmentsForHIT(string hitID) { GetAssignmentsForHITRequest request = new GetAssignmentsForHITRequest(); request.HITId = hitID; request.PageNumber = 1; request.PageSize = 10; GetAssignmentsForHITResponse response = (GetAssignmentsForHITResponse)TestUtil.Client.SendRequest(request); Assert.IsTrue(response.GetAssignmentsForHITResult.Length > 0, "No assignments found for request"); return response.GetAssignmentsForHITResult[0].Assignment; }
/// <summary> /// See <a href="http://docs.amazonwebservices.com/AWSMechTurk/2012-03-25/AWSMturkAPI/ApiReference_GetAssignmentsForHITOperation.html">online documentation for this operation.</a> /// </summary> /// <param name="hitId">The hit id.</param> /// <param name="sortDirection">The sort direction.</param> /// <param name="status">The status.</param> /// <param name="sortProperty">The sort property.</param> /// <param name="pageNumber">The page number.</param> /// <param name="pageSize">Size of the page.</param> /// <param name="responseGroup">The response group.</param> /// <returns> /// A <see cref="GetAssignmentsForHITResult"/> instance /// </returns> public GetAssignmentsForHITResult GetAssignmentsForHIT(string hitId, SortDirection? sortDirection, AssignmentStatus[] status, GetAssignmentsForHITSortProperty? sortProperty, int? pageNumber, int? pageSize, string[] responseGroup) { GetAssignmentsForHITRequest request = new GetAssignmentsForHITRequest(); request.HITId = hitId; if (sortDirection.HasValue) { request.SortDirection = sortDirection.Value; request.SortDirectionSpecified = true; } if (sortProperty.HasValue) { request.SortProperty = sortProperty.Value; request.SortPropertySpecified = true; } if (pageNumber.HasValue) { request.PageNumber = pageNumber.Value; request.PageNumberSpecified = true; } if (pageSize.HasValue) { request.PageSize = pageSize.Value; request.PageSizeSpecified = true; } request.ResponseGroup = responseGroup; if (status != null && status.Length > 0) { request.AssignmentStatus = status; } return Proxy.GetAssignmentsForHIT(request); }