import random from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range, ) author = 'Eugene and Charlie' doc = """ A mental arithmetic task """ class Constants(BaseConstants): name_in_url = 'real_effort_numbers' players_per_group = None task_timer = 60 num_rounds = 1000 marks_per_correct_answer = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): consent = models.BooleanField(label="I have read and I agree with the points above.", choices=[ [True, "Yes"], [False, "No"], ] ) number_entered = models.IntegerField() sum_of_numbers = models.IntegerField() age = models.IntegerField(label="What is your age (years)?") # need to add prefer not to answer gender = models.StringField(label="What is your gender?", choices=["Female", "Male", "Non-binary", "Other (please describe" "as you wish)", "I'd prefer not to answer"] ) ethnicity = models.StringField(label="What is your ethnicity?", choices=["White", "Mixed/Multiple Ethnicity", "Asian/Asian British", "Black/African/Caribbean/Black British", "I’d prefer not to answer"] )