summaryrefslogtreecommitdiff
path: root/jb/models/definitions.py
diff options
context:
space:
mode:
Diffstat (limited to 'jb/models/definitions.py')
-rw-r--r--jb/models/definitions.py90
1 files changed, 90 insertions, 0 deletions
diff --git a/jb/models/definitions.py b/jb/models/definitions.py
new file mode 100644
index 0000000..a3d27ba
--- /dev/null
+++ b/jb/models/definitions.py
@@ -0,0 +1,90 @@
+from enum import IntEnum, StrEnum
+
+
+class AssignmentStatus(IntEnum):
+ # boto3.mturk specific
+ Submitted = 0 # same thing as Reviewable
+ Approved = 1
+ Rejected = 2
+
+ # GRL specific
+ Accepted = 3
+ PreviewState = 4
+ # Invalid = 5
+ # NotExist = 6
+
+
+class HitStatus(IntEnum):
+ """
+ https://docs.aws.amazon.com/AWSMechTurk/latest/AWSMturkAPI/ApiReference_HITDataStructureArticle.html
+ """
+
+ # Official boto3.mturk
+ Assignable = 0
+ Unassignable = 1
+ Reviewable = 2
+ Reviewing = 3
+ Disposed = 4
+
+ # GRL Specific
+ NotExist = 5
+
+
+class HitReviewStatus(IntEnum):
+ NotReviewed = 0
+ MarkedForReview = 1
+ ReviewedAppropriate = 2
+ ReviewedInappropriate = 3
+
+
+class PayoutStatus(StrEnum):
+ """These are GRL's payout statuses"""
+
+ # The user has requested a payout. The money is taken from their
+ # wallet. A PENDING request can either be APPROVED, REJECTED, or
+ # CANCELLED. We can also implicitly skip the APPROVED step and go
+ # straight to COMPLETE or FAILED.
+ PENDING = "PENDING"
+ # The request is approved (by us or automatically). Once approved,
+ # it can be FAILED or COMPLETE.
+ APPROVED = "APPROVED"
+ # The request is rejected. The user loses the money.
+ REJECTED = "REJECTED"
+ # The user requests to cancel the request, the money goes back into their wallet.
+ CANCELLED = "CANCELLED"
+ # The payment was approved, but failed within external payment provider.
+ # This is an "error" state, as the money won't have moved anywhere. A
+ # FAILED payment can be tried again and be COMPLETE.
+ FAILED = "FAILED"
+ # The payment was sent successfully and (usually) a fee was charged
+ # to us for it.
+ COMPLETE = "COMPLETE"
+ # Not supported # REFUNDED: I'm not sure if this is possible or
+ # if we'd want to allow it.
+
+
+class ReportValue(IntEnum):
+ """
+ The reason a user reported a task.
+ """
+
+ # Used to indicate the user exited the task without giving feedback
+ REASON_UNKNOWN = 0
+ # Task is in the wrong language/country, unanswerable question, won't proceed to
+ # next question, loading forever, error message
+ TECHNICAL_ERROR = 1
+ # Task ended (completed or failed, and showed the user some dialog
+ # indicating the task was over), but failed to redirect
+ NO_REDIRECT = 2
+ # Asked for full name, home address, identity on another site, cc#
+ PRIVACY_INVASION = 3
+ # Asked about children, employer, medical issues, drug use, STDs, etc.
+ UNCOMFORTABLE_TOPICS = 4
+ # Asked to install software, signup/login to external site, access webcam,
+ # promise to pay using external site, etc.
+ ASKED_FOR_NOT_ALLOWED_ACTION = 5
+ # Task doesn't work well on a mobile device
+ BAD_ON_MOBILE = 6
+ # Too long, too boring, confusing, complicated, too many
+ # open-ended/free-response questions
+ DIDNT_LIKE = 7