aboutsummaryrefslogtreecommitdiff
path: root/jb/models/definitions.py
blob: a3d27ba9942a7451fc87cda2b7d549dbfac2a4dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
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