Example #1
0
class Player(otree.models.BasePlayer):

    # <built-in>
    group = models.ForeignKey(Group, null=True)
    subsession = models.ForeignKey(Subsession)
    # </built-in>

    name = models.CharField(max_length=255, verbose_name="Your name")

    age = models.CharField(max_length=255, verbose_name="Your age")

    email = models.EmailField(verbose_name="Your email address")

    gender = models.CharField(verbose_name="Are you",
                              max_length=255,
                              widget=widgets.RadioSelect(),
                              choices=["Male", "Female"])

    major = models.CharField(max_length=1000,
                             verbose_name="What is your major?")

    location_of_your_partners_influence_your_decisions = models.TextField(
        verbose_name=("Did the location of your partners influence your "
                      "decisions of how much to contribute to the individual "
                      "account versus the team account? If yes, how?"))

    working_in_a_location_of_their_choice_more_less_to_the_team = models.BooleanField(
        widget=widgets.RadioSelect(),
        verbose_name=("When you were partnered with two people working in a "
                      "location of their choice, did you want to give more "
                      "to the team or less than when you were partnered "
                      "with two people working in a lab?"))

    partners_in_location_their_choice_worked_harder_than_the_lab = models.BooleanField(
        widget=widgets.RadioSelect(),
        verbose_name=("Do you believe your partners participation in a "
                      "location of their choice gave more to the group than "
                      "your partners working the lab?"))

    I_work_best_in = models.CharField(
        verbose_name="Are you",
        max_length=255,
        widget=widgets.RadioSelect(),
        choices=["Structured environments", "flexible environments"])

    risks_in_everyday_life = models.PositiveIntegerField(
        min=1,
        max=10,
        widget=widgets.SliderInput(),
        verbose_name=("In general, do you take more or less risks in everyday "
                      "life? ('1' = take less risk and '10' take more risk.)"))

    risks_in_financial_decision = models.PositiveIntegerField(
        min=1,
        max=10,
        widget=widgets.SliderInput(),
        default=5,
        verbose_name=
        (" In general, do you take more or less risks in financial decisions? "
         "life? ('1' = take less risk and '10' take more risk.)"))
Example #2
0
class FormFieldModel(otree.models.BaseGroup):
    null_boolean = models.BooleanField()
    big_integer = models.BigIntegerField()
    boolean = models.BooleanField(default=False)
    char = models.CharField()
    comma_separated_integer = models.CommaSeparatedIntegerField(max_length=100)
    date = models.DateField()
    date_time = models.DateTimeField()
    alt_date_time = models.DateTimeField(
        widget=otree.forms.SplitDateTimeWidget)
    decimal = models.DecimalField(max_digits=5, decimal_places=2)
    email = models.EmailField()
    file = models.FileField(upload_to='_tmp/uploads')
    file_path = models.FilePathField()
    float = models.FloatField()
    integer = models.IntegerField()
    generic_ip_address = models.GenericIPAddressField()
    positive_integer = models.PositiveIntegerField()
    positive_small_integer = models.PositiveSmallIntegerField()
    slug = models.SlugField()
    small_integer = models.SmallIntegerField()
    text = models.TextField()
    alt_text = models.TextField(widget=otree.forms.TextInput)
    time = models.TimeField()
    url = models.URLField()
    many_to_many = models.ManyToManyField('SimpleModel', related_name='+')
    one_to_one = models.OneToOneField('SimpleModel', related_name='+')

    currency = models.CurrencyField()
    currency_choice = models.CurrencyField(choices=[('0.01',
                                                     '0.01'), ('1.20',
                                                               '1.20')])

    sent_amount = models.CurrencyField(choices=currency_range(0, 0.75, 0.05))
    slider_widget = models.IntegerField(widget=widgets.SliderInput())
Example #3
0
class Player(otree.models.BasePlayer):

    # <built-in>
    group = models.ForeignKey(Group, null=True)
    subsession = models.ForeignKey(Subsession)
    # </built-in>

    name = models.CharField(max_length=255, verbose_name="Your name")

    email = models.EmailField(verbose_name="Your email address")
Example #4
0
class Player(otree.models.BasePlayer):

    # <built-in>
    group = models.ForeignKey(Group, null=True)
    subsession = models.ForeignKey(Subsession)
    # </built-in>

    name = models.CharField(max_length=255, verbose_name="Your name")

    age = models.CharField(max_length=255, verbose_name="Your age")

    email = models.EmailField(verbose_name="Your email address")

    gender = models.CharField(verbose_name="Are you",
                              max_length=255,
                              widget=widgets.RadioSelect(),
                              choices=["Male", "Female"])

    major = models.CharField(max_length=1000,
                             verbose_name="What is your major?")

    working_in_a_location_of_their_choice_more_less_to_the_team = models.CharField(
        verbose_name=
        "When you were in a group with two TELECOMMUTERS working in a "
        "location and time of their choice, did you want to give more "
        "to the group account than when you were partnered "
        "with two LAB PARTICIPANTS?",
        max_length=500,
        widget=widgets.RadioSelect(),
        choices=[
            "More to the Group Account with TELECOMMUTERS",
            "Less to the Group Account with TELECOMMUTERS", "Didn't Matter"
        ])

    partners_in_location_their_choice_worked_harder_than_the_lab = models.CharField(
        verbose_name=
        "Do you believe your TELECOMMUTER group members gave more/less/the same to the group "
        "account than your LAB PARTICIPANT group members?",
        max_length=500,
        widget=widgets.RadioSelect(),
        choices=[
            "TELECOMMUTERS gave more", "TELECOMMUTERS gave less",
            "Both types gave the same"
        ])

    location_of_your_partners_influence_your_decisions = models.TextField(
        verbose_name=(
            "Did your group members' type (TELECOMMUTERS or LAB PARTICIPANTS) "
            "influence your decisions today in a way not accounted for above? "
            "If so, please explain."))

    I_work_best_in = models.CharField(
        verbose_name="Which do you prefer working in?",
        max_length=255,
        widget=widgets.RadioSelect(),
        choices=["Structured environments", "flexible environments"])

    I_work_prefer = models.CharField(
        verbose_name="Which type of work do you prefer?",
        max_length=255,
        widget=widgets.RadioSelect(),
        choices=["Working Alone", "Working in Groups"])

    risks_in_everyday_life = models.PositiveIntegerField(
        min=1,
        max=10,
        widget=widgets.SliderInput(),
        verbose_name=("In general, do you take more or less risks in everyday "
                      "life? ('1' = take less risk and '10' take more risk.)"))

    risks_in_financial_decision = models.PositiveIntegerField(
        min=1,
        max=10,
        widget=widgets.SliderInput(),
        default=5,
        verbose_name=
        (" In general, do you take more or less risks in financial decisions? "
         "life? ('1' = take less risk and '10' take more risk.)"))