Documentation ¶
Overview ¶
Package amt implements an API for crowdsourcing questions through Amazon Mechanical Turk. This package implement the low-level API calls exposed by AMT.
The operations exposed here are documented by Amazon: http://docs.aws.amazon.com/AWSMechTurk/latest/AWSMturkAPI/ApiReference_OperationsArticle.html
Known issues:
- The QuestionForm is not smart enough to marshal elements in the correct order. This is a drawback of encoding/xml.
- QuestionFormAnswers Marshals several empty fields.
Index ¶
- Constants
- func EncodeQuestion(question HITQuestion) ([]byte, error)
- func FormatNow() string
- func FormatTime(t time.Time) string
- type AmtClient
- type AnswerKey
- type ExternalQuestion
- type HITQuestion
- type HTMLQuestion
- type MockAmtClient
- func (_m *MockAmtClient) ApproveAssignment(assignmentId string, requesterFeedback string) (AWSMechanicalTurkRequester_xsd_go.TxsdApproveAssignmentResponse, error)
- func (_m *MockAmtClient) ApproveRejectedAssignment(assignmentId string, requesterFeedback string) (AWSMechanicalTurkRequester_xsd_go.TxsdApproveRejectedAssignmentResponse, error)
- func (_m *MockAmtClient) AssignQualification(qualificationTypeId string, workerId string, integerValue int, ...) (AWSMechanicalTurkRequester_xsd_go.TxsdAssignQualificationResponse, error)
- func (_m *MockAmtClient) BlockWorker(workerId string, reason string) (AWSMechanicalTurkRequester_xsd_go.TxsdBlockWorkerResponse, error)
- func (_m *MockAmtClient) ChangeHITTypeOfHIT(hitId string, hitTypeId string) (AWSMechanicalTurkRequester_xsd_go.TxsdChangeHITTypeOfHITResponse, error)
- func (_m *MockAmtClient) CreateHIT(title string, description string, question string, hitLayoutId string, ...) (AWSMechanicalTurkRequester_xsd_go.TxsdCreateHITResponse, error)
- func (_m *MockAmtClient) CreateHITFromArgs(args AWSMechanicalTurkRequester_xsd_go.TCreateHITRequest) (AWSMechanicalTurkRequester_xsd_go.TxsdCreateHITResponse, error)
- func (_m *MockAmtClient) CreateHITFromHITTypeId(hitTypeId string, question string, hitLayoutId string, ...) (AWSMechanicalTurkRequester_xsd_go.TxsdCreateHITResponse, error)
- func (_m *MockAmtClient) CreateQualificationType(name string, description string, keywords []string, retryDelayInSeconds int, ...) (AWSMechanicalTurkRequester_xsd_go.TxsdCreateQualificationTypeResponse, error)
- func (_m *MockAmtClient) DisableHIT(hitId string) (AWSMechanicalTurkRequester_xsd_go.TxsdDisableHITResponse, error)
- func (_m *MockAmtClient) DisposeHIT(hitId string) (AWSMechanicalTurkRequester_xsd_go.TxsdDisposeHITResponse, error)
- func (_m *MockAmtClient) DisposeQualificationType(qualificationTypeId string) (AWSMechanicalTurkRequester_xsd_go.TxsdDisposeQualificationTypeResponse, error)
- func (_m *MockAmtClient) EXPECT() *_MockAmtClientRecorder
- func (_m *MockAmtClient) ExtendHIT(hitId string, maxAssignmentsIncrement int, expirationIncrementInSeconds int, ...) (AWSMechanicalTurkRequester_xsd_go.TxsdExtendHITResponse, error)
- func (_m *MockAmtClient) ForceExpireHIT(hitId string) (AWSMechanicalTurkRequester_xsd_go.TxsdForceExpireHITResponse, error)
- func (_m *MockAmtClient) GetAccountBalance() (AWSMechanicalTurkRequester_xsd_go.TxsdGetAccountBalanceResponse, error)
- func (_m *MockAmtClient) GetAssignment(assignmentId string) (AWSMechanicalTurkRequester_xsd_go.TxsdGetAssignmentResponse, error)
- func (_m *MockAmtClient) GetAssignmentsForHIT(hitId string, assignmentStatuses []string, sortProperty string, ...) (AWSMechanicalTurkRequester_xsd_go.TxsdGetAssignmentsForHITResponse, error)
- func (_m *MockAmtClient) GetBlockedWorkers(pageSize int, pageNumber int) (AWSMechanicalTurkRequester_xsd_go.TxsdGetBlockedWorkersResponse, error)
- func (_m *MockAmtClient) GetBonusPayments(hitId string, assignmentId string, pageSize int, pageNumber int) (AWSMechanicalTurkRequester_xsd_go.TxsdGetBonusPaymentsResponse, error)
- func (_m *MockAmtClient) GetFileUploadURL(assignmentId string, questionIdentifier string) (AWSMechanicalTurkRequester_xsd_go.TxsdGetFileUploadURLResponse, error)
- func (_m *MockAmtClient) GetHIT(hitId string) (AWSMechanicalTurkRequester_xsd_go.TxsdGetHITResponse, error)
- func (_m *MockAmtClient) GetHITsForQualificationType(qualificationTypeId string, pageSize int, pageNumber int) (AWSMechanicalTurkRequester_xsd_go.TxsdGetHITsForQualificationTypeResponse, ...)
- func (_m *MockAmtClient) GetQualificationRequests(qualificationTypeId string, sortProperty string, sortAscending bool, ...) (AWSMechanicalTurkRequester_xsd_go.TxsdGetQualificationRequestsResponse, error)
- func (_m *MockAmtClient) GetQualificationScore(qualificationTypeId string, subjectId string) (AWSMechanicalTurkRequester_xsd_go.TxsdGetQualificationScoreResponse, error)
- func (_m *MockAmtClient) GetQualificationType(qualificationTypeId string) (AWSMechanicalTurkRequester_xsd_go.TxsdGetQualificationTypeResponse, error)
- func (_m *MockAmtClient) GetQualificationsForQualificationType(qualificationTypeId string, isGranted bool, pageSize int, pageNumber int) (...)
- func (_m *MockAmtClient) GetRequesterStatistic(statistic string, timePeriod string, count int) (AWSMechanicalTurkRequester_xsd_go.TxsdGetRequesterStatisticResponse, error)
- func (_m *MockAmtClient) GetRequesterWorkerStatistic(statistic string, workerId string, timePeriod string, count int) (AWSMechanicalTurkRequester_xsd_go.TxsdGetRequesterWorkerStatisticResponse, ...)
- func (_m *MockAmtClient) GetReviewResultsForHIT(hitId string, policyLevels []string, retrieveActions bool, ...) (AWSMechanicalTurkRequester_xsd_go.TxsdGetReviewResultsForHITResponse, error)
- func (_m *MockAmtClient) GetReviewableHITs(hitTypeId string, status string, sortProperty string, sortAscending bool, ...) (AWSMechanicalTurkRequester_xsd_go.TxsdGetReviewableHITsResponse, error)
- func (_m *MockAmtClient) GrantBonus(workerId string, assignmentId string, bonusAmount float32, reason string, ...) (AWSMechanicalTurkRequester_xsd_go.TxsdGrantBonusResponse, error)
- func (_m *MockAmtClient) GrantQualification(qualificationRequestId string, integerValue int) (AWSMechanicalTurkRequester_xsd_go.TxsdGrantQualificationResponse, error)
- func (_m *MockAmtClient) NotifyWorkers(subject string, messageText string, workerIds []string) (AWSMechanicalTurkRequester_xsd_go.TxsdNotifyWorkersResponse, error)
- func (_m *MockAmtClient) RegisterHITType(title string, description string, reward float32, ...) (AWSMechanicalTurkRequester_xsd_go.TxsdRegisterHITTypeResponse, error)
- func (_m *MockAmtClient) RegisterHITTypeFromArgs(args AWSMechanicalTurkRequester_xsd_go.TRegisterHITTypeRequest) (AWSMechanicalTurkRequester_xsd_go.TxsdRegisterHITTypeResponse, error)
- func (_m *MockAmtClient) RejectAssignment(assignmentId string, requesterFeedback string) (AWSMechanicalTurkRequester_xsd_go.TxsdRejectAssignmentResponse, error)
- func (_m *MockAmtClient) RejectQualificationRequest(qualificationRequestId string, reason string) (AWSMechanicalTurkRequester_xsd_go.TxsdRejectQualificationRequestResponse, ...)
- func (_m *MockAmtClient) RevokeQualification(subjectId string, qualificationTypeId string, reason string) (AWSMechanicalTurkRequester_xsd_go.TxsdRevokeQualificationResponse, error)
- func (_m *MockAmtClient) SearchHITs(sortProperty string, sortAscending bool, pageSize int, pageNumber int) (AWSMechanicalTurkRequester_xsd_go.TxsdSearchHITsResponse, error)
- func (_m *MockAmtClient) SearchQualificationTypes(query string, sortProperty string, sortAscending bool, pageSize int, ...) (AWSMechanicalTurkRequester_xsd_go.TxsdSearchQualificationTypesResponse, error)
- func (_m *MockAmtClient) SendTestEventNotification(notification *AWSMechanicalTurkRequester_xsd_go.TNotificationSpecification, ...) (AWSMechanicalTurkRequester_xsd_go.TxsdSendTestEventNotificationResponse, error)
- func (_m *MockAmtClient) SetHITAsReviewing(hitID string, revert bool) (AWSMechanicalTurkRequester_xsd_go.TxsdSetHITAsReviewingResponse, error)
- func (_m *MockAmtClient) SetHITTypeNotification(hitTypeID string, ...) (AWSMechanicalTurkRequester_xsd_go.TxsdSetHITTypeNotificationResponse, error)
- func (_m *MockAmtClient) UnblockWorker(workerId string, reason string) (AWSMechanicalTurkRequester_xsd_go.TxsdUnblockWorkerResponse, error)
- func (_m *MockAmtClient) UpdateQualificationScore(qualificationTypeId string, subjectId string, integerValue int) (AWSMechanicalTurkRequester_xsd_go.TxsdUpdateQualificationScoreResponse, error)
- func (_m *MockAmtClient) UpdateQualificationType(qualificationTypeId string, retryDelayInSeconds int, ...) (AWSMechanicalTurkRequester_xsd_go.TxsdUpdateQualificationTypeResponse, error)
- type QuestionForm
- func (question *QuestionForm) AddBinaryContent(mimeType, mimeSubType string, dataURL *url.URL, altText string)
- func (question *QuestionForm) AddEmbeddedBinaryContent(dataURL *url.URL, altText string, width, height int, ...)
- func (question *QuestionForm) AddFileUploadAnswer(minSize, maxSize int)
- func (question *QuestionForm) AddFlashApplicationContent(flashMovieURL *url.URL, width, height int, ...)
- func (question *QuestionForm) AddFormattedContent(formattedContent string)
- func (question *QuestionForm) AddFreeTextAnswerDefaultText(text string)
- func (question *QuestionForm) AddFreeTextAnswerLengthConstraints(min, max int)
- func (question *QuestionForm) AddFreeTextAnswerNumberOfLinesSuggestion(lines int)
- func (question *QuestionForm) AddFreeTextAnswerNumericConstraints(min, max int)
- func (question *QuestionForm) AddJavaAppletApplicationContent(appletFilename string, width, height int, ...)
- func (question *QuestionForm) AddListContent(listItems []string)
- func (question *QuestionForm) AddOverview()
- func (question *QuestionForm) AddQuestion(questionIdentifier, displayName string, isRequired bool)
- func (question *QuestionForm) AddSelectionAnswerBinarySelection(selectionIdentifier, mimeType, mimeSubType string, dataURL *url.URL, ...)
- func (question *QuestionForm) AddSelectionAnswerFormattedContentSelection(selectionIdentifier, content string)
- func (question *QuestionForm) AddSelectionAnswerMaxSelections(selections int)
- func (question *QuestionForm) AddSelectionAnswerMinSelections(selections int)
- func (question *QuestionForm) AddSelectionAnswerStyle(style string)
- func (question *QuestionForm) AddSelectionAnswerTextSelection(selectionIdentifier, text string)
- func (question *QuestionForm) AddTextContent(text string)
- func (question *QuestionForm) AddTitleContent(title string)
- type QuestionFormAnswers
Constants ¶
const ( AMT_SERVICE = "AWSMechanicalTurkRequester" API_VERSION = "2014-08-15" CURRENCY_USD = "USD" URL_SANDBOX = "https://mechanicalturk.sandbox.amazonaws.com" URL_PROD = "https://mechanicalturk.amazonaws.com" )
Variables ¶
This section is empty.
Functions ¶
func EncodeQuestion ¶
func EncodeQuestion(question HITQuestion) ([]byte, error)
Encode a question to send to Amazon
func FormatTime ¶
Formats a timestamp in the format required by AMT (2005-01-31T23:59:59Z)
Types ¶
type AmtClient ¶
type AmtClient interface { ApproveAssignment(assignmentId, requesterFeedback string) (amtgen.TxsdApproveAssignmentResponse, error) ApproveRejectedAssignment(assignmentId, requesterFeedback string) (amtgen.TxsdApproveRejectedAssignmentResponse, error) AssignQualification(qualificationTypeId, workerId string, integerValue int, sendNotification bool) (amtgen.TxsdAssignQualificationResponse, error) BlockWorker(workerId, reason string) (amtgen.TxsdBlockWorkerResponse, error) ChangeHITTypeOfHIT(hitId, hitTypeId string) (amtgen.TxsdChangeHITTypeOfHITResponse, error) CreateHIT(title, description, question string, hitLayoutId string, hitLayoutParameters map[string]string, reward float32, assignmentDurationInSeconds, lifetimeInSeconds, maxAssignments, autoApprovalDelayInSeconds int, keywords []string, qualificationRequirements []*amtgen.TQualificationRequirement, assignmentReviewPolicy, hitReviewPolicy *amtgen.TReviewPolicy, requesterAnnotation, uniqueRequestToken string) (amtgen.TxsdCreateHITResponse, error) CreateHITFromArgs(args amtgen.TCreateHITRequest) (amtgen.TxsdCreateHITResponse, error) CreateHITFromHITTypeId(hitTypeId, question string, hitLayoutId string, hitLayoutParameters map[string]string, lifetimeInSeconds, maxAssignments int, assignmentReviewPolicy, hitReviewPolicy *amtgen.TReviewPolicy, requesterAnnotation, uniqueRequestToken string) (amtgen.TxsdCreateHITResponse, error) CreateQualificationType(name, description string, keywords []string, retryDelayInSeconds int, qualificationTypeStatus, test, answerKey string, testDurationInSeconds int, autoGranted bool, autoGrantedValue int) (amtgen.TxsdCreateQualificationTypeResponse, error) DisableHIT(hitId string) (amtgen.TxsdDisableHITResponse, error) DisposeHIT(hitId string) (amtgen.TxsdDisposeHITResponse, error) DisposeQualificationType(qualificationTypeId string) (amtgen.TxsdDisposeQualificationTypeResponse, error) ExtendHIT(hitId string, maxAssignmentsIncrement, expirationIncrementInSeconds int, uniqueRequestToken string) (amtgen.TxsdExtendHITResponse, error) ForceExpireHIT(hitId string) (amtgen.TxsdForceExpireHITResponse, error) GetAccountBalance() (amtgen.TxsdGetAccountBalanceResponse, error) GetAssignment(assignmentId string) (amtgen.TxsdGetAssignmentResponse, error) GetAssignmentsForHIT(hitId string, assignmentStatuses []string, sortProperty string, sortAscending bool, pageSize, pageNumber int) (amtgen.TxsdGetAssignmentsForHITResponse, error) GetBlockedWorkers(pageSize, pageNumber int) (amtgen.TxsdGetBlockedWorkersResponse, error) GetBonusPayments(hitId, assignmentId string, pageSize, pageNumber int) (amtgen.TxsdGetBonusPaymentsResponse, error) GetFileUploadURL(assignmentId, questionIdentifier string) (amtgen.TxsdGetFileUploadURLResponse, error) GetHIT(hitId string) (amtgen.TxsdGetHITResponse, error) GetHITsForQualificationType(qualificationTypeId string, pageSize, pageNumber int) (amtgen.TxsdGetHITsForQualificationTypeResponse, error) GetQualificationRequests(qualificationTypeId, sortProperty string, sortAscending bool, pageSize, pageNumber int) (amtgen.TxsdGetQualificationRequestsResponse, error) GetQualificationScore(qualificationTypeId, subjectId string) (amtgen.TxsdGetQualificationScoreResponse, error) GetQualificationsForQualificationType(qualificationTypeId string, isGranted bool, pageSize, pageNumber int) (amtgen.TxsdGetQualificationsForQualificationTypeResponse, error) GetQualificationType(qualificationTypeId string) (amtgen.TxsdGetQualificationTypeResponse, error) GetRequesterStatistic(statistic, timePeriod string, count int) (amtgen.TxsdGetRequesterStatisticResponse, error) GetRequesterWorkerStatistic(statistic, workerId, timePeriod string, count int) (amtgen.TxsdGetRequesterWorkerStatisticResponse, error) GetReviewableHITs(hitTypeId, status, sortProperty string, sortAscending bool, pageSize, pageNumber int) (amtgen.TxsdGetReviewableHITsResponse, error) GetReviewResultsForHIT(hitId string, policyLevels []string, retrieveActions, retrieveResults bool, pageSize, pageNumber int) (amtgen.TxsdGetReviewResultsForHITResponse, error) GrantBonus(workerId, assignmentId string, bonusAmount float32, reason, uniqueRequestToken string) (amtgen.TxsdGrantBonusResponse, error) GrantQualification(qualificationRequestId string, integerValue int) (amtgen.TxsdGrantQualificationResponse, error) NotifyWorkers(subject, messageText string, workerIds []string) (amtgen.TxsdNotifyWorkersResponse, error) RegisterHITType(title, description string, reward float32, assignmentDurationInSeconds, autoApprovalDelayInSeconds int, keywords []string, qualificationRequirements []*amtgen.TQualificationRequirement) (amtgen.TxsdRegisterHITTypeResponse, error) RegisterHITTypeFromArgs(args amtgen.TRegisterHITTypeRequest) (amtgen.TxsdRegisterHITTypeResponse, error) RejectAssignment(assignmentId, requesterFeedback string) (amtgen.TxsdRejectAssignmentResponse, error) RejectQualificationRequest(qualificationRequestId, reason string) (amtgen.TxsdRejectQualificationRequestResponse, error) RevokeQualification(subjectId, qualificationTypeId, reason string) (amtgen.TxsdRevokeQualificationResponse, error) SearchHITs(sortProperty string, sortAscending bool, pageSize, pageNumber int) (amtgen.TxsdSearchHITsResponse, error) SearchQualificationTypes(query, sortProperty string, sortAscending bool, pageSize, pageNumber int, mustBeRequestable, mustBeOwnedByCaller bool) (amtgen.TxsdSearchQualificationTypesResponse, error) SendTestEventNotification(notification *amtgen.TNotificationSpecification, testEventType string) (amtgen.TxsdSendTestEventNotificationResponse, error) SetHITAsReviewing(hitID string, revert bool) (amtgen.TxsdSetHITAsReviewingResponse, error) SetHITTypeNotification(hitTypeID string, notification *amtgen.TNotificationSpecification, active bool) (amtgen.TxsdSetHITTypeNotificationResponse, error) UnblockWorker(workerId, reason string) (amtgen.TxsdUnblockWorkerResponse, error) UpdateQualificationScore(qualificationTypeId, subjectId string, integerValue int) (amtgen.TxsdUpdateQualificationScoreResponse, error) UpdateQualificationType(qualificationTypeId string, retryDelayInSeconds int, qualificationTypeStatus, description, test, answerKey string, testDurationInSeconds int, autoGranted bool, autoGrantedValue int) (amtgen.TxsdUpdateQualificationTypeResponse, error) }
AmtClient is an interface for interacting with AMT.
type AnswerKey ¶
type AnswerKey struct { // The name of the wrapper element for an XML representation of the object XMLName xml.Name `xml:"http://mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2005-10-01/AnswerKey.xsd AnswerKey"` // The answer key. answerkey.TxsdAnswerKey }
AnswerKey allows you to provide known answers against which workers can be graded. This is used, for example, for qualifications.
type ExternalQuestion ¶
type ExternalQuestion struct { // The name of the wrapper element for an XML representation of the object XMLName xml.Name `xml:"http://mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2006-07-14/ExternalQuestion.xsd ExternalQuestion"` externalquestion.XsdGoPkgHasElem_ExternalURLsequenceTxsdExternalQuestionExternalQuestionschema_ExternalURL_XsdtAnyURI_ externalquestion.XsdGoPkgHasElem_FrameHeightsequenceTxsdExternalQuestionExternalQuestionschema_FrameHeight_XsdtInteger_ }
ExternalQuestion is a HITQuestion that uses the ExternalQuestion XML schema. These questions are hosted by your own server.
type HITQuestion ¶
type HITQuestion interface{}
HITQuestion is used to initialize HIT questions.
func DecodeQuestion ¶
func DecodeQuestion(questionXml []byte) (HITQuestion, error)
Decode a question in a response from Amazon
type HTMLQuestion ¶
type HTMLQuestion struct { // The name of the wrapper element for an XML representation of the object XMLName xml.Name `xml:"http://mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2011-11-11/HTMLQuestion.xsd HTMLQuestion"` // The question. Exposes the following top-level properties: // HTMLContent xsdt.String: The HTML for the question. // FrameHeight xsdt.Integer: The height of the HTML frame to hold the question. htmlquestion.TxsdHTMLQuestion }
HTMLQuestion is a HITQuestion that uses the HTMLQuestion XML schema. These questions are hosted by Amazon using arbitrary HTML you provide.
type MockAmtClient ¶
type MockAmtClient struct {
// contains filtered or unexported fields
}
Mock of AmtClient interface
func NewMockAmtClient ¶
func NewMockAmtClient(ctrl *gomock.Controller) *MockAmtClient
func (*MockAmtClient) ApproveAssignment ¶
func (_m *MockAmtClient) ApproveAssignment(assignmentId string, requesterFeedback string) (AWSMechanicalTurkRequester_xsd_go.TxsdApproveAssignmentResponse, error)
func (*MockAmtClient) ApproveRejectedAssignment ¶
func (_m *MockAmtClient) ApproveRejectedAssignment(assignmentId string, requesterFeedback string) (AWSMechanicalTurkRequester_xsd_go.TxsdApproveRejectedAssignmentResponse, error)
func (*MockAmtClient) AssignQualification ¶
func (_m *MockAmtClient) AssignQualification(qualificationTypeId string, workerId string, integerValue int, sendNotification bool) (AWSMechanicalTurkRequester_xsd_go.TxsdAssignQualificationResponse, error)
func (*MockAmtClient) BlockWorker ¶
func (_m *MockAmtClient) BlockWorker(workerId string, reason string) (AWSMechanicalTurkRequester_xsd_go.TxsdBlockWorkerResponse, error)
func (*MockAmtClient) ChangeHITTypeOfHIT ¶
func (_m *MockAmtClient) ChangeHITTypeOfHIT(hitId string, hitTypeId string) (AWSMechanicalTurkRequester_xsd_go.TxsdChangeHITTypeOfHITResponse, error)
func (*MockAmtClient) CreateHIT ¶
func (_m *MockAmtClient) CreateHIT(title string, description string, question string, hitLayoutId string, hitLayoutParameters map[string]string, reward float32, assignmentDurationInSeconds int, lifetimeInSeconds int, maxAssignments int, autoApprovalDelayInSeconds int, keywords []string, qualificationRequirements []*AWSMechanicalTurkRequester_xsd_go.TQualificationRequirement, assignmentReviewPolicy *AWSMechanicalTurkRequester_xsd_go.TReviewPolicy, hitReviewPolicy *AWSMechanicalTurkRequester_xsd_go.TReviewPolicy, requesterAnnotation string, uniqueRequestToken string) (AWSMechanicalTurkRequester_xsd_go.TxsdCreateHITResponse, error)
func (*MockAmtClient) CreateHITFromArgs ¶
func (_m *MockAmtClient) CreateHITFromArgs(args AWSMechanicalTurkRequester_xsd_go.TCreateHITRequest) (AWSMechanicalTurkRequester_xsd_go.TxsdCreateHITResponse, error)
func (*MockAmtClient) CreateHITFromHITTypeId ¶
func (_m *MockAmtClient) CreateHITFromHITTypeId(hitTypeId string, question string, hitLayoutId string, hitLayoutParameters map[string]string, lifetimeInSeconds int, maxAssignments int, assignmentReviewPolicy *AWSMechanicalTurkRequester_xsd_go.TReviewPolicy, hitReviewPolicy *AWSMechanicalTurkRequester_xsd_go.TReviewPolicy, requesterAnnotation string, uniqueRequestToken string) (AWSMechanicalTurkRequester_xsd_go.TxsdCreateHITResponse, error)
func (*MockAmtClient) CreateQualificationType ¶
func (_m *MockAmtClient) CreateQualificationType(name string, description string, keywords []string, retryDelayInSeconds int, qualificationTypeStatus string, test string, answerKey string, testDurationInSeconds int, autoGranted bool, autoGrantedValue int) (AWSMechanicalTurkRequester_xsd_go.TxsdCreateQualificationTypeResponse, error)
func (*MockAmtClient) DisableHIT ¶
func (_m *MockAmtClient) DisableHIT(hitId string) (AWSMechanicalTurkRequester_xsd_go.TxsdDisableHITResponse, error)
func (*MockAmtClient) DisposeHIT ¶
func (_m *MockAmtClient) DisposeHIT(hitId string) (AWSMechanicalTurkRequester_xsd_go.TxsdDisposeHITResponse, error)
func (*MockAmtClient) DisposeQualificationType ¶
func (_m *MockAmtClient) DisposeQualificationType(qualificationTypeId string) (AWSMechanicalTurkRequester_xsd_go.TxsdDisposeQualificationTypeResponse, error)
func (*MockAmtClient) EXPECT ¶
func (_m *MockAmtClient) EXPECT() *_MockAmtClientRecorder
func (*MockAmtClient) ExtendHIT ¶
func (_m *MockAmtClient) ExtendHIT(hitId string, maxAssignmentsIncrement int, expirationIncrementInSeconds int, uniqueRequestToken string) (AWSMechanicalTurkRequester_xsd_go.TxsdExtendHITResponse, error)
func (*MockAmtClient) ForceExpireHIT ¶
func (_m *MockAmtClient) ForceExpireHIT(hitId string) (AWSMechanicalTurkRequester_xsd_go.TxsdForceExpireHITResponse, error)
func (*MockAmtClient) GetAccountBalance ¶
func (_m *MockAmtClient) GetAccountBalance() (AWSMechanicalTurkRequester_xsd_go.TxsdGetAccountBalanceResponse, error)
func (*MockAmtClient) GetAssignment ¶
func (_m *MockAmtClient) GetAssignment(assignmentId string) (AWSMechanicalTurkRequester_xsd_go.TxsdGetAssignmentResponse, error)
func (*MockAmtClient) GetAssignmentsForHIT ¶
func (_m *MockAmtClient) GetAssignmentsForHIT(hitId string, assignmentStatuses []string, sortProperty string, sortAscending bool, pageSize int, pageNumber int) (AWSMechanicalTurkRequester_xsd_go.TxsdGetAssignmentsForHITResponse, error)
func (*MockAmtClient) GetBlockedWorkers ¶
func (_m *MockAmtClient) GetBlockedWorkers(pageSize int, pageNumber int) (AWSMechanicalTurkRequester_xsd_go.TxsdGetBlockedWorkersResponse, error)
func (*MockAmtClient) GetBonusPayments ¶
func (_m *MockAmtClient) GetBonusPayments(hitId string, assignmentId string, pageSize int, pageNumber int) (AWSMechanicalTurkRequester_xsd_go.TxsdGetBonusPaymentsResponse, error)
func (*MockAmtClient) GetFileUploadURL ¶
func (_m *MockAmtClient) GetFileUploadURL(assignmentId string, questionIdentifier string) (AWSMechanicalTurkRequester_xsd_go.TxsdGetFileUploadURLResponse, error)
func (*MockAmtClient) GetHIT ¶
func (_m *MockAmtClient) GetHIT(hitId string) (AWSMechanicalTurkRequester_xsd_go.TxsdGetHITResponse, error)
func (*MockAmtClient) GetHITsForQualificationType ¶
func (_m *MockAmtClient) GetHITsForQualificationType(qualificationTypeId string, pageSize int, pageNumber int) (AWSMechanicalTurkRequester_xsd_go.TxsdGetHITsForQualificationTypeResponse, error)
func (*MockAmtClient) GetQualificationRequests ¶
func (_m *MockAmtClient) GetQualificationRequests(qualificationTypeId string, sortProperty string, sortAscending bool, pageSize int, pageNumber int) (AWSMechanicalTurkRequester_xsd_go.TxsdGetQualificationRequestsResponse, error)
func (*MockAmtClient) GetQualificationScore ¶
func (_m *MockAmtClient) GetQualificationScore(qualificationTypeId string, subjectId string) (AWSMechanicalTurkRequester_xsd_go.TxsdGetQualificationScoreResponse, error)
func (*MockAmtClient) GetQualificationType ¶
func (_m *MockAmtClient) GetQualificationType(qualificationTypeId string) (AWSMechanicalTurkRequester_xsd_go.TxsdGetQualificationTypeResponse, error)
func (*MockAmtClient) GetQualificationsForQualificationType ¶
func (_m *MockAmtClient) GetQualificationsForQualificationType(qualificationTypeId string, isGranted bool, pageSize int, pageNumber int) (AWSMechanicalTurkRequester_xsd_go.TxsdGetQualificationsForQualificationTypeResponse, error)
func (*MockAmtClient) GetRequesterStatistic ¶
func (_m *MockAmtClient) GetRequesterStatistic(statistic string, timePeriod string, count int) (AWSMechanicalTurkRequester_xsd_go.TxsdGetRequesterStatisticResponse, error)
func (*MockAmtClient) GetRequesterWorkerStatistic ¶
func (_m *MockAmtClient) GetRequesterWorkerStatistic(statistic string, workerId string, timePeriod string, count int) (AWSMechanicalTurkRequester_xsd_go.TxsdGetRequesterWorkerStatisticResponse, error)
func (*MockAmtClient) GetReviewResultsForHIT ¶
func (_m *MockAmtClient) GetReviewResultsForHIT(hitId string, policyLevels []string, retrieveActions bool, retrieveResults bool, pageSize int, pageNumber int) (AWSMechanicalTurkRequester_xsd_go.TxsdGetReviewResultsForHITResponse, error)
func (*MockAmtClient) GetReviewableHITs ¶
func (_m *MockAmtClient) GetReviewableHITs(hitTypeId string, status string, sortProperty string, sortAscending bool, pageSize int, pageNumber int) (AWSMechanicalTurkRequester_xsd_go.TxsdGetReviewableHITsResponse, error)
func (*MockAmtClient) GrantBonus ¶
func (_m *MockAmtClient) GrantBonus(workerId string, assignmentId string, bonusAmount float32, reason string, uniqueRequestToken string) (AWSMechanicalTurkRequester_xsd_go.TxsdGrantBonusResponse, error)
func (*MockAmtClient) GrantQualification ¶
func (_m *MockAmtClient) GrantQualification(qualificationRequestId string, integerValue int) (AWSMechanicalTurkRequester_xsd_go.TxsdGrantQualificationResponse, error)
func (*MockAmtClient) NotifyWorkers ¶
func (_m *MockAmtClient) NotifyWorkers(subject string, messageText string, workerIds []string) (AWSMechanicalTurkRequester_xsd_go.TxsdNotifyWorkersResponse, error)
func (*MockAmtClient) RegisterHITType ¶
func (_m *MockAmtClient) RegisterHITType(title string, description string, reward float32, assignmentDurationInSeconds int, autoApprovalDelayInSeconds int, keywords []string, qualificationRequirements []*AWSMechanicalTurkRequester_xsd_go.TQualificationRequirement) (AWSMechanicalTurkRequester_xsd_go.TxsdRegisterHITTypeResponse, error)
func (*MockAmtClient) RegisterHITTypeFromArgs ¶
func (_m *MockAmtClient) RegisterHITTypeFromArgs(args AWSMechanicalTurkRequester_xsd_go.TRegisterHITTypeRequest) (AWSMechanicalTurkRequester_xsd_go.TxsdRegisterHITTypeResponse, error)
func (*MockAmtClient) RejectAssignment ¶
func (_m *MockAmtClient) RejectAssignment(assignmentId string, requesterFeedback string) (AWSMechanicalTurkRequester_xsd_go.TxsdRejectAssignmentResponse, error)
func (*MockAmtClient) RejectQualificationRequest ¶
func (_m *MockAmtClient) RejectQualificationRequest(qualificationRequestId string, reason string) (AWSMechanicalTurkRequester_xsd_go.TxsdRejectQualificationRequestResponse, error)
func (*MockAmtClient) RevokeQualification ¶
func (_m *MockAmtClient) RevokeQualification(subjectId string, qualificationTypeId string, reason string) (AWSMechanicalTurkRequester_xsd_go.TxsdRevokeQualificationResponse, error)
func (*MockAmtClient) SearchHITs ¶
func (_m *MockAmtClient) SearchHITs(sortProperty string, sortAscending bool, pageSize int, pageNumber int) (AWSMechanicalTurkRequester_xsd_go.TxsdSearchHITsResponse, error)
func (*MockAmtClient) SearchQualificationTypes ¶
func (_m *MockAmtClient) SearchQualificationTypes(query string, sortProperty string, sortAscending bool, pageSize int, pageNumber int, mustBeRequestable bool, mustBeOwnedByCaller bool) (AWSMechanicalTurkRequester_xsd_go.TxsdSearchQualificationTypesResponse, error)
func (*MockAmtClient) SendTestEventNotification ¶
func (_m *MockAmtClient) SendTestEventNotification(notification *AWSMechanicalTurkRequester_xsd_go.TNotificationSpecification, testEventType string) (AWSMechanicalTurkRequester_xsd_go.TxsdSendTestEventNotificationResponse, error)
func (*MockAmtClient) SetHITAsReviewing ¶
func (_m *MockAmtClient) SetHITAsReviewing(hitID string, revert bool) (AWSMechanicalTurkRequester_xsd_go.TxsdSetHITAsReviewingResponse, error)
func (*MockAmtClient) SetHITTypeNotification ¶
func (_m *MockAmtClient) SetHITTypeNotification(hitTypeID string, notification *AWSMechanicalTurkRequester_xsd_go.TNotificationSpecification, active bool) (AWSMechanicalTurkRequester_xsd_go.TxsdSetHITTypeNotificationResponse, error)
func (*MockAmtClient) UnblockWorker ¶
func (_m *MockAmtClient) UnblockWorker(workerId string, reason string) (AWSMechanicalTurkRequester_xsd_go.TxsdUnblockWorkerResponse, error)
func (*MockAmtClient) UpdateQualificationScore ¶
func (_m *MockAmtClient) UpdateQualificationScore(qualificationTypeId string, subjectId string, integerValue int) (AWSMechanicalTurkRequester_xsd_go.TxsdUpdateQualificationScoreResponse, error)
func (*MockAmtClient) UpdateQualificationType ¶
func (_m *MockAmtClient) UpdateQualificationType(qualificationTypeId string, retryDelayInSeconds int, qualificationTypeStatus string, description string, test string, answerKey string, testDurationInSeconds int, autoGranted bool, autoGrantedValue int) (AWSMechanicalTurkRequester_xsd_go.TxsdUpdateQualificationTypeResponse, error)
type QuestionForm ¶
type QuestionForm struct { // The name of the wrapper element for an XML representation of the object XMLName xml.Name `xml:"http://mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2005-10-01/QuestionForm.xsd QuestionForm"` // The raw XML from which the form was parsed XMLContent string `xml:",innerxml"` // The question. Exposes the following top-level properties: // Overviews []*questionform.TContentType: Information to display above the questions. // Questions []*questionform.TxsdQuestionFormSequenceChoiceQuestion: The questions. questionform.TxsdQuestionForm // contains filtered or unexported fields }
QuestionForm is a HITQuestion that uses the QuestionForm XML schema. These questions are hosted by Amazon using a standard form interface.
Helper methods are provided to construct the form. In particular, Overview and Question elements will be marshalled into the output XML in the order added, provided you use AddOverview(), AddQuestion(), and EncodeQuestion().
func (*QuestionForm) AddBinaryContent ¶
func (question *QuestionForm) AddBinaryContent(mimeType, mimeSubType string, dataURL *url.URL, altText string)
Add a Binary item to the most recent Question/Overview added.
func (*QuestionForm) AddEmbeddedBinaryContent ¶
func (question *QuestionForm) AddEmbeddedBinaryContent( dataURL *url.URL, altText string, width, height int, applicationParameters map[string]string, mimeType, mimeSubType string)
Add an EmbeddedBinary item to the most recent Question/Overview added.
func (*QuestionForm) AddFileUploadAnswer ¶
func (question *QuestionForm) AddFileUploadAnswer(minSize, maxSize int)
Add a file upload answer
func (*QuestionForm) AddFlashApplicationContent ¶
func (question *QuestionForm) AddFlashApplicationContent(flashMovieURL *url.URL, width, height int, applicationParameters map[string]string)
Add a Flash Application item to the most recent Question/Overview added.
func (*QuestionForm) AddFormattedContent ¶
func (question *QuestionForm) AddFormattedContent(formattedContent string)
Add a FormattedContent item to the most recent Question/Overview added.
func (*QuestionForm) AddFreeTextAnswerDefaultText ¶
func (question *QuestionForm) AddFreeTextAnswerDefaultText(text string)
Add default text for a free text answer specification
func (*QuestionForm) AddFreeTextAnswerLengthConstraints ¶
func (question *QuestionForm) AddFreeTextAnswerLengthConstraints(min, max int)
Add length constraints for a free text answer specification
func (*QuestionForm) AddFreeTextAnswerNumberOfLinesSuggestion ¶
func (question *QuestionForm) AddFreeTextAnswerNumberOfLinesSuggestion(lines int)
Add suggested number of lines for a free text answer specification
func (*QuestionForm) AddFreeTextAnswerNumericConstraints ¶
func (question *QuestionForm) AddFreeTextAnswerNumericConstraints(min, max int)
Add numeric value constraints for a free text answer specification
func (*QuestionForm) AddJavaAppletApplicationContent ¶
func (question *QuestionForm) AddJavaAppletApplicationContent( appletFilename string, width, height int, applicationParameters map[string]string, appletPath *url.URL)
Add a JavaApplet Application item to the most recent Question/Overview added.
func (*QuestionForm) AddListContent ¶
func (question *QuestionForm) AddListContent(listItems []string)
Add a List item to the most recent Question/Overview added.
func (*QuestionForm) AddOverview ¶
func (question *QuestionForm) AddOverview()
Add a new Overview item, to be populated by subsequent content-adding method calls.
func (*QuestionForm) AddQuestion ¶
func (question *QuestionForm) AddQuestion(questionIdentifier, displayName string, isRequired bool)
Add a new Question item, to be populated by subsequent content-adding method calls.
func (*QuestionForm) AddSelectionAnswerBinarySelection ¶
func (question *QuestionForm) AddSelectionAnswerBinarySelection( selectionIdentifier, mimeType, mimeSubType string, dataURL *url.URL, altText string)
Add a binary option for a selection answer
func (*QuestionForm) AddSelectionAnswerFormattedContentSelection ¶
func (question *QuestionForm) AddSelectionAnswerFormattedContentSelection( selectionIdentifier, content string)
Add a formatted content option for a selection answer
func (*QuestionForm) AddSelectionAnswerMaxSelections ¶
func (question *QuestionForm) AddSelectionAnswerMaxSelections(selections int)
Add maximum number of selections for a selection answer
func (*QuestionForm) AddSelectionAnswerMinSelections ¶
func (question *QuestionForm) AddSelectionAnswerMinSelections(selections int)
Add minimum number of selections for a selection answer
func (*QuestionForm) AddSelectionAnswerStyle ¶
func (question *QuestionForm) AddSelectionAnswerStyle(style string)
Add style suggestion for a selection answer
func (*QuestionForm) AddSelectionAnswerTextSelection ¶
func (question *QuestionForm) AddSelectionAnswerTextSelection( selectionIdentifier, text string)
Add a text option for a selection answer
func (*QuestionForm) AddTextContent ¶
func (question *QuestionForm) AddTextContent(text string)
Add a Text item to the most recent Question/Overview added.
func (*QuestionForm) AddTitleContent ¶
func (question *QuestionForm) AddTitleContent(title string)
Add a Title item to the most recent Question/Overview added.
type QuestionFormAnswers ¶
type QuestionFormAnswers struct { // The name of the wrapper element for an XML representation of the object XMLName xml.Name `xml:"http://mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2005-10-01/QuestionFormAnswers.xsd QuestionFormAnswers"` // The answers questionformanswers.TxsdQuestionFormAnswers }
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
gen
|
|
mechanicalturk.amazonaws.com/AWSMechanicalTurk/2014-08-15/AWSMechanicalTurkRequester.xsd_go
Auto-generated by the "go-xsd" package located at: github.com/metaleap/go-xsd Comments on types and fields (if any) are from the XSD file located at: mechanicalturk.amazonaws.com/AWSMechanicalTurk/2014-08-15/AWSMechanicalTurkRequester.xsd
|
Auto-generated by the "go-xsd" package located at: github.com/metaleap/go-xsd Comments on types and fields (if any) are from the XSD file located at: mechanicalturk.amazonaws.com/AWSMechanicalTurk/2014-08-15/AWSMechanicalTurkRequester.xsd |
mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2005-10-01/AnswerKey.xsd_go
Auto-generated by the "go-xsd" package located at: github.com/metaleap/go-xsd Comments on types and fields (if any) are from the XSD file located at: mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2005-10-01/AnswerKey.xsd
|
Auto-generated by the "go-xsd" package located at: github.com/metaleap/go-xsd Comments on types and fields (if any) are from the XSD file located at: mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2005-10-01/AnswerKey.xsd |
mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2005-10-01/QuestionForm.xsd_go
Auto-generated by the "go-xsd" package located at: github.com/metaleap/go-xsd Comments on types and fields (if any) are from the XSD file located at: mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2005-10-01/QuestionForm.xsd
|
Auto-generated by the "go-xsd" package located at: github.com/metaleap/go-xsd Comments on types and fields (if any) are from the XSD file located at: mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2005-10-01/QuestionForm.xsd |
mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2005-10-01/QuestionFormAnswers.xsd_go
Auto-generated by the "go-xsd" package located at: github.com/metaleap/go-xsd Comments on types and fields (if any) are from the XSD file located at: mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2005-10-01/QuestionFormAnswers.xsd
|
Auto-generated by the "go-xsd" package located at: github.com/metaleap/go-xsd Comments on types and fields (if any) are from the XSD file located at: mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2005-10-01/QuestionFormAnswers.xsd |
mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2006-07-14/ExternalQuestion.xsd_go
Auto-generated by the "go-xsd" package located at: github.com/metaleap/go-xsd Comments on types and fields (if any) are from the XSD file located at: mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2006-07-14/ExternalQuestion.xsd
|
Auto-generated by the "go-xsd" package located at: github.com/metaleap/go-xsd Comments on types and fields (if any) are from the XSD file located at: mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2006-07-14/ExternalQuestion.xsd |
mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2011-11-11/HTMLQuestion.xsd_go
Auto-generated by the "go-xsd" package located at: github.com/metaleap/go-xsd Comments on types and fields (if any) are from the XSD file located at: mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2011-11-11/HTMLQuestion.xsd
|
Auto-generated by the "go-xsd" package located at: github.com/metaleap/go-xsd Comments on types and fields (if any) are from the XSD file located at: mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2011-11-11/HTMLQuestion.xsd |