Esempio n. 1
0
class MTurkCreateHITForm(forms.Form):

    use_sandbox = forms.BooleanField(
        required=False,
        label='Use MTurk Sandbox (for development and testing)',
        help_text=("If this box is checked, your HIT will not be published to "
                   "the MTurk live site, but rather to the MTurk Sandbox, "
                   "so you can test how it will look to MTurk workers."))
    title = forms.CharField()
    description = forms.CharField()
    keywords = forms.CharField()
    money_reward = forms.RealWorldCurrencyField(
        # it seems that if this is omitted, the step defaults to an integer,
        # meaninng fractional inputs are not accepted
        widget=widgets._RealWorldCurrencyInput(attrs={'step': 0.01}))
    assignments = forms.IntegerField(
        label="Number of assignments",
        help_text="How many unique Workers do you want to work on the HIT?")
    minutes_allotted_per_assignment = forms.IntegerField(
        label="Minutes allotted per assignment",
        help_text=("Number of minutes, that a Worker has to "
                   "complete the HIT after accepting it."))
    expiration_hours = forms.FloatField(
        label="Hours until HIT expiration",
        help_text=("Number of hours after which the HIT "
                   "is no longer available for users to accept. "))

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.fields['assignments'].widget.attrs['readonly'] = True
Esempio n. 2
0
class SessionCreateHitForm(forms.Form):

    in_sandbox = forms.BooleanField(
        required=False,
        help_text="Do you want HIT published on MTurk sandbox?")
    title = forms.CharField()
    description = forms.CharField()
    keywords = forms.CharField()
    money_reward = forms.RealWorldCurrencyField()
    assignments = forms.IntegerField(
        label="Number of assignments",
        help_text="How many unique Workers do you want to work on the HIT?")
    minutes_allotted_per_assignment = forms.IntegerField(
        label="Minutes allotted per assignment",
        required=False,
        help_text=("Number of minutes, that a Worker has to "
                   "complete the HIT after accepting it."
                   "Leave it blank if you don't want to specify it."))
    expiration_hours = forms.IntegerField(
        label="Hours until HIT expiration",
        required=False,
        help_text=("Number of hours after which the HIT "
                   "is no longer available for users to accept. "
                   "Leave it blank if you don't want to specify it."))

    def __init__(self, *args, **kwargs):
        super(SessionCreateHitForm, self).__init__(*args, **kwargs)
        self.fields['assignments'].widget.attrs['readonly'] = True
Esempio n. 3
0
class MTurkCreateHITForm(forms.Form):

    in_sandbox = forms.BooleanField(
        required=False,
        help_text="Do you want HIT published on MTurk sandbox?")
    title = forms.CharField()
    description = forms.CharField()
    keywords = forms.CharField()
    money_reward = forms.RealWorldCurrencyField(
        # it seems that if this is omitted, the step defaults to an integer,
        # meaninng fractional inputs are not accepted
        widget=widgets.RealWorldCurrencyInput(attrs={'step': 0.01})
    )
    assignments = forms.IntegerField(
        label="Number of assignments",
        help_text="How many unique Workers do you want to work on the HIT?")
    minutes_allotted_per_assignment = forms.IntegerField(
        label="Minutes allotted per assignment",
        help_text=(
            "Number of minutes, that a Worker has to "
            "complete the HIT after accepting it."
        ))
    expiration_hours = forms.FloatField(
        label="Hours until HIT expiration",
        help_text=(
            "Number of hours after which the HIT "
            "is no longer available for users to accept. "
        ))

    def __init__(self, *args, **kwargs):
        super(MTurkCreateHITForm, self).__init__(*args, **kwargs)
        self.fields['assignments'].widget.attrs['readonly'] = True
Esempio n. 4
0
class SessionEditPropertiesForm(forms.Form):
    participation_fee = forms.RealWorldCurrencyField(
        required=False,
        # it seems that if this is omitted, the step defaults to an integer,
        # meaninng fractional inputs are not accepted
        widget=widgets._RealWorldCurrencyInput(attrs={'step': 0.01}),
    )
    real_world_currency_per_point = forms.FloatField(required=False)

    label = forms.CharField(required=False)
    comment = forms.CharField(required=False)
Esempio n. 5
0
class SessionEditPropertiesForm(forms.ModelForm):
    participation_fee = forms.RealWorldCurrencyField(
        required=False,
        # it seems that if this is omitted, the step defaults to an integer,
        # meaninng fractional inputs are not accepted
        widget=widgets._RealWorldCurrencyInput(attrs={'step': 0.01}))
    real_world_currency_per_point = forms.FloatField(required=False)

    class Meta:
        model = Session
        fields = [
            'label',
            'experimenter_name',
            'comment',
        ]
Esempio n. 6
0
class EditSessionPropertiesForm(forms.ModelForm):

    participation_fee = forms.RealWorldCurrencyField(required=False)
    real_world_currency_per_point = forms.DecimalField(decimal_places=5,
                                                       max_digits=12,
                                                       required=False)

    class Meta:
        model = Session
        fields = [
            'label',
            'experimenter_name',
            'time_scheduled',
            'comment',
        ]

    def __init__(self, *args, **kwargs):
        super(EditSessionPropertiesForm, self).__init__(*args, **kwargs)
Esempio n. 7
0
class EditSessionPropertiesForm(forms.ModelForm):
    participation_fee = forms.RealWorldCurrencyField(
        required=False,
        # it seems that if this is omitted, the step defaults to an integer,
        # meaninng fractional inputs are not accepted
        widget=widgets.RealWorldCurrencyInput(attrs={'step': 0.01}))
    real_world_currency_per_point = forms.DecimalField(decimal_places=5,
                                                       max_digits=12,
                                                       required=False)

    class Meta:
        model = Session
        fields = [
            'label',
            'experimenter_name',
            'time_scheduled',
            'comment',
        ]

    def __init__(self, *args, **kwargs):
        super(EditSessionPropertiesForm, self).__init__(*args, **kwargs)