com.amazonaws.mturk.service.axis
Class RequesterService

java.lang.Object
  extended by com.amazonaws.mturk.service.axis.AWSService
      extended by com.amazonaws.mturk.service.axis.FilteredAWSService
          extended by com.amazonaws.mturk.service.axis.RequesterServiceRaw
              extended by com.amazonaws.mturk.service.axis.RequesterService

public class RequesterService
extends RequesterServiceRaw

The RequesterService class provides a set of simplified APIs and convenience methods. It extends the RequesterServiceRaw class.


Field Summary
static java.lang.String ABANDONMENT_RATE_QUALIFICATION_TYPE_ID
           
static java.lang.String APPROVAL_RATE_QUALIFICATION_TYPE_ID
           
static long DEFAULT_ASSIGNMENT_DURATION_IN_SECONDS
           
static long DEFAULT_AUTO_APPROVAL_DELAY_IN_SECONDS
           
static long DEFAULT_LIFETIME_IN_SECONDS
           
static int DEFAULT_PAGE_NUM
           
static int DEFAULT_PAGE_SIZE
           
static SortDirection DEFAULT_SORT_DIRECTION
           
static int LOAD_ALL
           
static java.lang.String LOCALE_QUALIFICATION_TYPE_ID
           
static java.lang.String REJECTION_RATE_QUALIFICATION_TYPE_ID
           
static java.lang.String RETURN_RATE_QUALIFICATION_TYPE_ID
           
static java.lang.String SUBMISSION_RATE_QUALIFICATION_TYPE_ID
           
 
Fields inherited from class com.amazonaws.mturk.service.axis.RequesterServiceRaw
NOTIFICATION_VERSION, service, stubCache
 
Fields inherited from class com.amazonaws.mturk.service.axis.AWSService
config, HTTP_HEADER_AMAZON_SOFTWARE, httpHeaders
 
Constructor Summary
RequesterService()
          Deprecated. 
RequesterService(ClientConfig config)
           
 
Method Summary
 void appendApplicationSignature(java.lang.String signature)
           
 void approveAssignments(java.lang.String[] assignmentIds, java.lang.String[] requesterFeedback, java.lang.String defaultFeedback, BatchItemCallback callback)
          Approves all assignments using the Axis worker thread pool.
 HIT createHIT(java.lang.String title, java.lang.String description, double reward, java.lang.String question, int maxAssignments)
          Creates a HIT using default values for the HIT properties not given as parameters.
 HIT createHIT(java.lang.String title, java.lang.String description, double reward, java.lang.String question, int maxAssignments, boolean getFullResponse)
          Creates a HIT using defaults for the HIT properties not given as parameters.
 HIT[] createHITs(HITDataInput input, HITProperties props, HITQuestion question, HITDataOutput success, HITDataOutput failure)
          Creates HITs in bulk.
 HIT[] createHITs(HITDataInput input, HITProperties props, HITQuestion question, int numHITToLoad, HITDataOutput success, HITDataOutput failure)
          Creates HITs in bulk.
 HIT[] createHITs(HITDataReader input, HITProperties props, HITQuestion question)
          Deprecated. 
 HIT[] createHITs(HITDataReader input, HITProperties props, HITQuestion question, int numHITToLoad)
          Deprecated. 
 QualificationType createQualificationType(java.lang.String name, java.lang.String keywords, java.lang.String description)
          Creates a Qualification Type using default values for the Qualification Type properties not given as parameters.
 QualificationType createSingleCheckboxQualificationType(java.lang.String name, java.lang.String description, java.lang.String keywords)
          Creates a single checkbox Qualification Type.
 void deleteHITs(java.lang.String[] hitIds, boolean approve, boolean expire, BatchItemCallback callback)
           
 QualificationType disposeQualificationType(java.lang.String qualificationTypeId)
          Disposes the given Qualification Type.
 void extendHITs(java.lang.String[] hitIds, java.lang.Integer maxAssignmentsIncrement, java.lang.Long expirationIncrementInSeconds, BatchItemCallback callback)
           
static java.lang.String formatCurrency(double value)
          Formats the given double value into the currency format.
 double getAccountBalance()
          Retrieves requester's available balance.
 Assignment[] getAllAssignmentsForHIT(java.lang.String hitId)
          Retrieves all of requester's assignments for the given HIT.
 Assignment[] getAllAssignmentsForHIT(java.lang.String hitId, AssignmentStatus[] status)
          Retrieves all of requester's assignments for the given HIT that are in a certain status
 QualificationRequest[] getAllQualificationRequests(java.lang.String qualificationTypeId)
          Retrieves all QualificationRequests for the given Qualification Type.
 Qualification[] getAllQualificationsForQualificationType(java.lang.String qualificationTypeId)
           
 QualificationType[] getAllQualificationTypes()
          Retrieves all active Qualifications in the system.
 HIT[] getAllReviewableHITs(java.lang.String hitTypeId)
          Retrieves all of requester's reviewable HITs of the given HIT Type.
 Assignment[] getAllSubmittedAssignmentsForHIT(java.lang.String hitId)
          Retrieves all of requester's assignments for the given HIT for which rewiewable work is submitted.
static java.lang.String getAnswerValue(java.lang.String assignmentId, QuestionFormAnswersType.AnswerType answer)
           
static java.lang.String getAnswerValue(java.lang.String assignmentId, QuestionFormAnswersType.AnswerType answer, boolean includeQuestionId)
          Extracts the answer values from the given AnswerType object.
 Assignment[] getAssignmentsForHIT(java.lang.String hitId, int pageNum)
          Retrieves workers' Assignments found on the requested page for the given HIT.
 Assignment[] getAssignmentsForHIT(java.lang.String hitId, int pageNum, boolean getFullResponse)
          Retrieves workers' Assignments found on the first page for the given HIT.
protected  java.lang.String getBasicCheckboxQualificationAnswerKey()
          Constructs a Qualification AnswerKey XML String for the simple checkbox QualificationTest.
protected  java.lang.String getBasicCheckboxQualificationTest(java.lang.String name)
          Constructs a QualificationTest XML String that contains a simple checkbox.
static java.lang.String getBasicFreeTextQuestion(java.lang.String question)
          Constructs a Question XML String that contains a single question.
 HIT getHIT(java.lang.String hitId)
          Retrieves a HIT by HIT Id.
 HITTypeResults getHITTypeResults(HITDataInput success)
          Get the results for a HIT Type.
 HITTypeResults getHITTypeResults(HITDataInput success, HITDataOutput output)
          Deprecated.  
 Qualification[] getQualicationsForQualificationType(java.lang.String qualificationTypeId, int pageNum)
          Deprecated.  
 QualificationRequest[] getQualificationRequests(java.lang.String qualificationTypeId)
          Retrieves workers' QualificationRequests found on the first page for the given Qualification Type.
 Qualification[] getQualificationsForQualificationType(java.lang.String qualificationTypeId, int pageNum)
          Retrieves workers' Qualifications found on the requested page for the given Qualification Type.
 void getResults(HITDataInput success, BatchItemCallback callback)
           
 HIT[] getReviewableHITs(java.lang.String hitTypeId, int pageNum)
          Retrieves requester's reviewable HITs found on the requested page for the given HIT Type.
 int getTotalNumHITsInAccount()
          Retrieves the total number of active HITs for the requester.
 java.lang.String getWebsiteURL()
          Returns the URL for the Mechanical Turk website.
static QuestionFormAnswers parseAnswers(java.lang.String answerXML)
          Extracts the QuestionFormAnswers object from the given answer XML.
 java.lang.String previewHIT(HITDataInput input, HITProperties props, HITQuestion question)
          Return a preview of the HIT in HTML
 void previewHIT(java.lang.String previewFileName, HITDataInput input, HITProperties props, HITQuestion question)
           
 HIT[] searchAllHITs()
          Retrieves all active HITs in the system.
 HIT[] searchHITs(int pageNum)
          Retrieves any HITs found on the requested page.
 HIT[] searchHITs(int pageNum, boolean getFullResponse)
          Retrieves requester's reviewable HITs found on the requested page for the given HIT Type.
 QualificationType[] searchQualificationTypes(int pageNum)
          Retrieves any Qualification Types found on the requested page.
 void sendTestEmailEventNotification(java.lang.String hitTypeId, java.lang.String emailAddress, EventType event)
          Sets up an email notification setting for the given HIT Type.
 void setHITAsReviewable(java.lang.String hitId)
          Sets the status of the given HIT as Reviewable.
 void setHITAsReviewing(java.lang.String hitId)
          Sets the status of the given HIT as Reviewing.
 java.lang.String updateHIT(java.lang.String hitId, java.lang.String title, java.lang.String description, java.lang.String keywords, java.lang.Double reward)
          Updates a HIT using defaults for the HIT properties not given as parameters.
 java.lang.String[] updateHITs(java.lang.String[] hitIds, java.lang.String newHITTypeId)
          Updates HITs in bulk.
 QualificationType updateQualificationType(java.lang.String qualificationTypeId, java.lang.String description, QualificationTypeStatus status)
          Creates a Qualification Type with no test using default values for the Qualification Type properties not given as parameters.
 
Methods inherited from class com.amazonaws.mturk.service.axis.RequesterServiceRaw
appendApplicationSignature, approveAssignment, approveAssignmentAsync, assignQualification, blockWorker, changeHITTypeOfHIT, changeHITTypeOfHITAsync, createHIT, createHITAsync, createQualificationType, disableHIT, disposeHIT, disposeHITAsync, extendHIT, extendHITAsync, forceExpireHIT, getAccountBalance, getAssignmentsForHIT, getAssignmentsForHITAsync, getAssignmentsForHITAsync, getBonusPayments, getFileUploadURL, getHIT, getHITAsync, getHITsForQualificationType, getPackagePrefix, getPort, getQualificationRequests, getQualificationScore, getQualificationsForQualificationType, getQualificationType, getRequesterStatistic, getReviewableHITs, getServiceName, getWorkerAcceptLimit, grantBonus, grantQualification, help, notifyWorkers, registerHITType, rejectAssignment, rejectQualificationRequest, revokeQualification, searchHITs, searchQualificationTypes, sendTestEventNotification, setHITAsReviewing, setHITTypeNotification, setWorkerAcceptLimit, unblockWorker, updateQualificationScore, updateQualificationType
 
Methods inherited from class com.amazonaws.mturk.service.axis.FilteredAWSService
addFilter, clearFilters, executeAsyncRequest, executeAsyncRequests, executeRequest, executeRequest, executeRequests, executeRequests, getFilterList, removeFilter
 
Methods inherited from class com.amazonaws.mturk.service.axis.AWSService
executeRequestMessage, getAWSAccessKeyId, getConfig, getSigner, setAccessKeyId, setSigner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PAGE_NUM

public static final int DEFAULT_PAGE_NUM
See Also:
Constant Field Values

DEFAULT_PAGE_SIZE

public static final int DEFAULT_PAGE_SIZE
See Also:
Constant Field Values

DEFAULT_SORT_DIRECTION

public static final SortDirection DEFAULT_SORT_DIRECTION

LOAD_ALL

public static final int LOAD_ALL
See Also:
Constant Field Values

DEFAULT_ASSIGNMENT_DURATION_IN_SECONDS

public static final long DEFAULT_ASSIGNMENT_DURATION_IN_SECONDS
See Also:
Constant Field Values

DEFAULT_AUTO_APPROVAL_DELAY_IN_SECONDS

public static final long DEFAULT_AUTO_APPROVAL_DELAY_IN_SECONDS
See Also:
Constant Field Values

DEFAULT_LIFETIME_IN_SECONDS

public static final long DEFAULT_LIFETIME_IN_SECONDS
See Also:
Constant Field Values

ABANDONMENT_RATE_QUALIFICATION_TYPE_ID

public static final java.lang.String ABANDONMENT_RATE_QUALIFICATION_TYPE_ID
See Also:
Constant Field Values

APPROVAL_RATE_QUALIFICATION_TYPE_ID

public static final java.lang.String APPROVAL_RATE_QUALIFICATION_TYPE_ID
See Also:
Constant Field Values

REJECTION_RATE_QUALIFICATION_TYPE_ID

public static final java.lang.String REJECTION_RATE_QUALIFICATION_TYPE_ID
See Also:
Constant Field Values

RETURN_RATE_QUALIFICATION_TYPE_ID

public static final java.lang.String RETURN_RATE_QUALIFICATION_TYPE_ID
See Also:
Constant Field Values

SUBMISSION_RATE_QUALIFICATION_TYPE_ID

public static final java.lang.String SUBMISSION_RATE_QUALIFICATION_TYPE_ID
See Also:
Constant Field Values

LOCALE_QUALIFICATION_TYPE_ID

public static final java.lang.String LOCALE_QUALIFICATION_TYPE_ID
See Also:
Constant Field Values
Constructor Detail

RequesterService

@Deprecated
public RequesterService()
Deprecated. 


RequesterService

public RequesterService(ClientConfig config)
Method Detail

createHIT

public HIT createHIT(java.lang.String title,
                     java.lang.String description,
                     double reward,
                     java.lang.String question,
                     int maxAssignments)
              throws ServiceException
Creates a HIT using default values for the HIT properties not given as parameters. The request uses the default responseGroup of "Minimal".

Parameters:
title -
description -
reward -
question -
maxAssignments -
Returns:
The created HIT
Throws:
ServiceException

createHIT

public HIT createHIT(java.lang.String title,
                     java.lang.String description,
                     double reward,
                     java.lang.String question,
                     int maxAssignments,
                     boolean getFullResponse)
              throws ServiceException
Creates a HIT using defaults for the HIT properties not given as parameters. The request uses either the default or full responseGroup.

Parameters:
title -
description -
reward -
question -
maxAssignments -
getFullResponse -
Returns:
The created HIT
Throws:
ServiceException

updateHIT

public java.lang.String updateHIT(java.lang.String hitId,
                                  java.lang.String title,
                                  java.lang.String description,
                                  java.lang.String keywords,
                                  java.lang.Double reward)
                           throws ServiceException
Updates a HIT using defaults for the HIT properties not given as parameters.

Parameters:
hitId -
title - - if null, the HIT's current title is used
description - - if null, the HIT's current description is used
reward - - if null, the HIT's current reward is used
Returns:
The new HITType Id
Throws:
ServiceException

updateHITs

public java.lang.String[] updateHITs(java.lang.String[] hitIds,
                                     java.lang.String newHITTypeId)
                              throws ServiceException
Updates HITs in bulk.

Parameters:
input -
newHITTypeId -
Returns:
Array of hitIds that were successfully updated
Throws:
ServiceException

deleteHITs

public void deleteHITs(java.lang.String[] hitIds,
                       boolean approve,
                       boolean expire,
                       BatchItemCallback callback)

extendHITs

public void extendHITs(java.lang.String[] hitIds,
                       java.lang.Integer maxAssignmentsIncrement,
                       java.lang.Long expirationIncrementInSeconds,
                       BatchItemCallback callback)
                throws ServiceException
Throws:
ServiceException

approveAssignments

public void approveAssignments(java.lang.String[] assignmentIds,
                               java.lang.String[] requesterFeedback,
                               java.lang.String defaultFeedback,
                               BatchItemCallback callback)
                        throws ServiceException
Approves all assignments using the Axis worker thread pool.

Parameters:
assignmentIds - Array of assignments to approve
requesterFeedback - Feedback (comments) for the assignments
defaultFeedback - Default feedback used when no requesterFeedback is specified for an assignment ID
callback - Callback function for item results processing
Throws:
ServiceException

getHIT

public HIT getHIT(java.lang.String hitId)
           throws ServiceException
Retrieves a HIT by HIT Id. The request uses full responseGroup.

Parameters:
hitId -
Returns:
A HIT object
Throws:
ServiceException

createQualificationType

public QualificationType createQualificationType(java.lang.String name,
                                                 java.lang.String keywords,
                                                 java.lang.String description)
                                          throws ServiceException
Creates a Qualification Type using default values for the Qualification Type properties not given as parameters.

Parameters:
name -
keywords -
description -
Returns:
The created QualificationType
Throws:
ServiceException

updateQualificationType

public QualificationType updateQualificationType(java.lang.String qualificationTypeId,
                                                 java.lang.String description,
                                                 QualificationTypeStatus status)
                                          throws ServiceException
Creates a Qualification Type with no test using default values for the Qualification Type properties not given as parameters.

Parameters:
qualificationTypeId -
description -
status -
Returns:
The updated QualificationType
Throws:
ServiceException

getQualicationsForQualificationType

public Qualification[] getQualicationsForQualificationType(java.lang.String qualificationTypeId,
                                                           int pageNum)
                                                    throws ServiceException
Deprecated. 

Retrieves workers' Qualifications found on the requested page for the given Qualification Type. The request uses the default responseGroup of "Minimal".

Parameters:
qualificationTypeId -
pageNum -
Returns:
An array of Qualifications
Throws:
ServiceException

getQualificationsForQualificationType

public Qualification[] getQualificationsForQualificationType(java.lang.String qualificationTypeId,
                                                             int pageNum)
                                                      throws ServiceException
Retrieves workers' Qualifications found on the requested page for the given Qualification Type. The request uses the default responseGroup of "Minimal".

Parameters:
qualificationTypeId -
pageNum -
Returns:
An array of Qualifications
Throws:
ServiceException

getAllQualificationsForQualificationType

public Qualification[] getAllQualificationsForQualificationType(java.lang.String qualificationTypeId)
                                                         throws java.lang.Exception
Throws:
java.lang.Exception

getQualificationRequests

public QualificationRequest[] getQualificationRequests(java.lang.String qualificationTypeId)
                                                throws ServiceException
Retrieves workers' QualificationRequests found on the first page for the given Qualification Type. The results are sorted by SubmitTime.

Parameters:
qualificationTypeId -
Returns:
An array of QualificationRequests
Throws:
ServiceException

getAllQualificationRequests

public QualificationRequest[] getAllQualificationRequests(java.lang.String qualificationTypeId)
                                                   throws ServiceException
Retrieves all QualificationRequests for the given Qualification Type. The results are sorted by SubmitTime.

Parameters:
qualificationTypeId -
Returns:
An array of QualificationRequests
Throws:
ServiceException

getAssignmentsForHIT

public Assignment[] getAssignmentsForHIT(java.lang.String hitId,
                                         int pageNum)
                                  throws ServiceException
Retrieves workers' Assignments found on the requested page for the given HIT. The request uses the default responseGroup of "Minimal".

Parameters:
hitId -
pageNum -
Returns:
An array of Assignments
Throws:
ServiceException

getAssignmentsForHIT

public Assignment[] getAssignmentsForHIT(java.lang.String hitId,
                                         int pageNum,
                                         boolean getFullResponse)
                                  throws ServiceException
Retrieves workers' Assignments found on the first page for the given HIT. The results are sorted by SubmitTime. The request uses either the default or full responseGroup.

Parameters:
hitId -
pageNum -
getFullResponse -
Returns:
An array of Assignments
Throws:
ServiceException

getAccountBalance

public double getAccountBalance()
                         throws ServiceException
Retrieves requester's available balance.

Returns:
requester's available balance
Throws:
ServiceException

getReviewableHITs

public HIT[] getReviewableHITs(java.lang.String hitTypeId,
                               int pageNum)
                        throws ServiceException
Retrieves requester's reviewable HITs found on the requested page for the given HIT Type.

Parameters:
hitId -
pageNum -
Returns:
An array of Reviewable HITs
Throws:
ServiceException

searchHITs

public HIT[] searchHITs(int pageNum)
                 throws ServiceException
Retrieves any HITs found on the requested page. The request uses the default responseGroup of "Minimal".

Parameters:
pageNum -
Returns:
An array of HITs
Throws:
ServiceException

searchHITs

public HIT[] searchHITs(int pageNum,
                        boolean getFullResponse)
                 throws ServiceException
Retrieves requester's reviewable HITs found on the requested page for the given HIT Type. The request uses either the default or full responseGroup.

Parameters:
pageNum -
getFullResponse -
Returns:
An array of HITs
Throws:
ServiceException

searchQualificationTypes

public QualificationType[] searchQualificationTypes(int pageNum)
                                             throws ServiceException
Retrieves any Qualification Types found on the requested page.

Parameters:
pageNum -
Returns:
An array of QualificationTypes
Throws:
ServiceException

setHITAsReviewable

public void setHITAsReviewable(java.lang.String hitId)
                        throws ServiceException
Sets the status of the given HIT as Reviewable.

Parameters:
hitId -
Throws:
ServiceException

setHITAsReviewing

public void setHITAsReviewing(java.lang.String hitId)
                       throws ServiceException
Sets the status of the given HIT as Reviewing.

Parameters:
hitId -
Throws:
ServiceException

searchAllHITs

public HIT[] searchAllHITs()
                    throws ServiceException
Retrieves all active HITs in the system. The request uses the full responseGroup.

Returns:
An array of HITs
Throws:
ServiceException

getAllQualificationTypes

public QualificationType[] getAllQualificationTypes()
                                             throws ServiceException
Retrieves all active Qualifications in the system.

Returns:
An array of QualificationTypes
Throws:
ServiceException

getAllReviewableHITs

public HIT[] getAllReviewableHITs(java.lang.String hitTypeId)
                           throws ServiceException
Retrieves all of requester's reviewable HITs of the given HIT Type.

Parameters:
hitTypeId -
Returns:
An array of Reviewable HITs
Throws:
ServiceException

getAllAssignmentsForHIT

public Assignment[] getAllAssignmentsForHIT(java.lang.String hitId)
                                     throws ServiceException
Retrieves all of requester's assignments for the given HIT.

Parameters:
hitId -
Returns:
An array of Assignments
Throws:
ServiceException

getAllSubmittedAssignmentsForHIT

public Assignment[] getAllSubmittedAssignmentsForHIT(java.lang.String hitId)
                                              throws ServiceException
Retrieves all of requester's assignments for the given HIT for which rewiewable work is submitted.

Parameters:
hitId -
Returns:
An array of Assignments
Throws:
ServiceException

getAllAssignmentsForHIT

public Assignment[] getAllAssignmentsForHIT(java.lang.String hitId,
                                            AssignmentStatus[] status)
                                     throws ServiceException
Retrieves all of requester's assignments for the given HIT that are in a certain status

Parameters:
hitId -
Returns:
An array of Assignments
Throws:
ServiceException

createSingleCheckboxQualificationType

public QualificationType createSingleCheckboxQualificationType(java.lang.String name,
                                                               java.lang.String description,
                                                               java.lang.String keywords)
                                                        throws ServiceException
Creates a single checkbox Qualification Type. The QualificationTest simply asks the worker to check off the box to receive a Qualification immediately.

Parameters:
name -
description -
keywords -
Returns:
The created QualificationType
Throws:
ServiceException

disposeQualificationType

public QualificationType disposeQualificationType(java.lang.String qualificationTypeId)
Disposes the given Qualification Type. The Qualification Type becomes inactive.

Parameters:
qualificationTypeId -
Returns:
The modified QualificationType
Throws:
ServiceException

getTotalNumHITsInAccount

public int getTotalNumHITsInAccount()
                             throws ServiceException
Retrieves the total number of active HITs for the requester.

Returns:
The total number of active HITs for the requester
Throws:
ServiceException

sendTestEmailEventNotification

public void sendTestEmailEventNotification(java.lang.String hitTypeId,
                                           java.lang.String emailAddress,
                                           EventType event)
Sets up an email notification setting for the given HIT Type.

Parameters:
hitTypeId -
emailAddress -
event -
Throws:
ServiceException
See Also:
http://docs.amazonwebservices.com/AWSMechanicalTurkRequester/2006-10-31/ApiReference_NotificationDataStructureArticle.html

parseAnswers

public static QuestionFormAnswers parseAnswers(java.lang.String answerXML)
Extracts the QuestionFormAnswers object from the given answer XML.

Parameters:
answerXML -
Returns:
A QuestionFormAnswers object that contains the answers
Throws:
ServiceException
See Also:
http://docs.amazonwebservices.com/AWSMechanicalTurkRequester/2006-10-31/ApiReference_QuestionFormAnswersDataStructureArticle.html

getAnswerValue

public static java.lang.String getAnswerValue(java.lang.String assignmentId,
                                              QuestionFormAnswersType.AnswerType answer)

getAnswerValue

public static java.lang.String getAnswerValue(java.lang.String assignmentId,
                                              QuestionFormAnswersType.AnswerType answer,
                                              boolean includeQuestionId)
Extracts the answer values from the given AnswerType object. When the answer type is Selections, returns the selections separated by the pipe character. When the answer type is UploadedFileKey, returns the S3 file key followed by the file's size in bytes.

Parameters:
assignmentId - If null, the upload URL might be invalid
answer -
includeQuestionId - Prepend the answer with the associated QuestionIdentifier and a tab
Returns:
A String representation of the answer
Throws:
ServiceException

createHITs

@Deprecated
public HIT[] createHITs(HITDataReader input,
                                   HITProperties props,
                                   HITQuestion question)
Deprecated. 


createHITs

public HIT[] createHITs(HITDataInput input,
                        HITProperties props,
                        HITQuestion question,
                        HITDataOutput success,
                        HITDataOutput failure)
                 throws java.lang.Exception
Creates HITs in bulk.

Parameters:
input -
properties -
question -
success -
failure -
Returns:
An array of HIT objects
Throws:
ServiceException
java.lang.Exception

createHITs

@Deprecated
public HIT[] createHITs(HITDataReader input,
                                   HITProperties props,
                                   HITQuestion question,
                                   int numHITToLoad)
Deprecated. 


createHITs

public HIT[] createHITs(HITDataInput input,
                        HITProperties props,
                        HITQuestion question,
                        int numHITToLoad,
                        HITDataOutput success,
                        HITDataOutput failure)
                 throws java.lang.Exception
Creates HITs in bulk.

Parameters:
input -
properties -
question -
numHITsToLoad -
success -
failure -
Returns:
An array of HIT objects
Throws:
ServiceException
java.lang.Exception

getHITTypeResults

public HITTypeResults getHITTypeResults(HITDataInput success)
Get the results for a HIT Type.

Parameters:
successget -
Returns:
A HITTypeResults object
Throws:
ServiceException

getResults

public void getResults(HITDataInput success,
                       BatchItemCallback callback)

getHITTypeResults

public HITTypeResults getHITTypeResults(HITDataInput success,
                                        HITDataOutput output)
                                 throws java.io.IOException
Deprecated. 

Get the results for a HIT Type and print each HIT results to a file.

Parameters:
success -
outputFile -
Returns:
A HITTypeResults object
Throws:
java.io.IOException
ServiceException

previewHIT

public void previewHIT(java.lang.String previewFileName,
                       HITDataInput input,
                       HITProperties props,
                       HITQuestion question)
                throws ServiceException
Throws:
ServiceException

previewHIT

public java.lang.String previewHIT(HITDataInput input,
                                   HITProperties props,
                                   HITQuestion question)
                            throws java.lang.Exception
Return a preview of the HIT in HTML

Parameters:
input -
properties -
question -
Returns:
An HTML preview of the HIT
Throws:
ServiceException
java.lang.Exception

appendApplicationSignature

public void appendApplicationSignature(java.lang.String signature)

getWebsiteURL

public java.lang.String getWebsiteURL()
Returns the URL for the Mechanical Turk website.

Returns:
URL

formatCurrency

public static java.lang.String formatCurrency(double value)
Formats the given double value into the currency format.

Parameters:
value -
Returns:
formatted value

getBasicFreeTextQuestion

public static java.lang.String getBasicFreeTextQuestion(java.lang.String question)
Constructs a Question XML String that contains a single question.

Parameters:
question - The question phrase to ask
Returns:
A Question XML

getBasicCheckboxQualificationTest

protected java.lang.String getBasicCheckboxQualificationTest(java.lang.String name)
Constructs a QualificationTest XML String that contains a simple checkbox.

Parameters:
name - The name of the Qualification Test
Returns:
A QualificationTest XML

getBasicCheckboxQualificationAnswerKey

protected java.lang.String getBasicCheckboxQualificationAnswerKey()
Constructs a Qualification AnswerKey XML String for the simple checkbox QualificationTest. The AnswerKey would assign a Qualification Score of 100 to the worker.

Returns:
A Qualification AnswerKey XML