from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range, ) author = 'Your name here' doc = """ Your app description """ class Constants(BaseConstants): name_in_url = 'prev2_socio_demo' players_per_group = None num_rounds = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): AGE = models.IntegerField(label='', min=18, max=99, blank=False) SEXE = models.IntegerField(label= '', widget= widgets.RadioSelect, choices=[[1,'Une femme'], [2,'Un homme'], [3,'Je refuse de répondre']], blank=False) ETUDIANT = models.IntegerField(label='', widget=widgets.RadioSelect, choices=[[1,'Oui'], [2,'Non'], [3, 'Je refuse de répondre']], blank=False) BOURSIER = models.IntegerField(label= '', widget= widgets.RadioSelect, choices=[[1,'Oui'], [2,'Non']], blank=False) DISCIPLINE = models.IntegerField(label = '', widget=widgets.RadioSelect, choices= [[1,'Sciences humaines et sociales'] , [2, 'Economie / gestion'], [3,'Santé'], [4, 'Arts Lettres Langues'], [5, 'Sciences et Technologies'], [6, 'Autre'], [7, 'Je n\'ai pas fait d\'étude'], [8, 'Je refuse de répondre']], blank=False) NIVEAU_ETUDE = models.IntegerField(label='', widget= widgets.RadioSelect, choices= [[1, 'Sans diplôme ou Brevet des collèges'], [2, 'CAP, BEP'], [3, 'Baccalauréat général, technologique ou professionnel'], [4, 'Diplôme de niveau Bac+2 (DUT, BTS, DEUG, Ecole des formations sanitaires ou sociales,...)'], [5, 'Licence'], [6, 'Master'], [7, 'Doctorat'], [8, 'Je refuse de répondre']], blank=False) DEPENSE_LOISIR = models.IntegerField(label='', widget= widgets.RadioSelect, choices= [[1, 'Moins de 100€'], [2, '100 - 200€'], [3, '200 - 300€'], [4, '300 - 400€'], [5, '400 - 500€'], [6, '500 - 600€'], [7, '600 - 700€'], [8, 'plus de 700€'], [9, 'Je refuse de répondre']], blank=False) LOYER_PAYEUR = models.IntegerField(label='', widget=widgets.RadioSelect, choices=[[1,'Oui'], [2,'Non'], [3, 'Je refuse de répondre']], blank=False) LOYER = models.IntegerField(label='', blank = False) PROPRIO = models.IntegerField(label='', widget= widgets.RadioSelect, choices= [[1, 'Oui'], [2, 'Non'], [3, 'Je refuse de répondre']], blank=False) NB_EXPERIENCE = models.IntegerField(blank=False, label="") DEBRIEF = models.LongStringField(blank=True, label="") PAIEMENT_LYDIA = models.FloatField() APP_SELECTED_LYDIA = models.StringField() ROUND_SELECTED_LYDIA = models.IntegerField() def paiement_lydia(self): self.PAIEMENT_LYDIA = self.participant.vars['PAIEMENT_PREV']