from random import choices from re import A from django.forms import RadioSelect from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range, ) author = 'Aoi Kokado' doc = """ 演習Ⅲ論文用実験 """ class Constants(BaseConstants): name_in_url = 'Jikken_2022' players_per_group = 2 num_rounds = 12 instructions_template = 'Jikken_2022/instructions.html' class Subsession(BaseSubsession): def creating_session(self): if self.round_number == 1: self.group_randomly() else: self.group_like_round(1) class Group(BaseGroup): total_points = models.CurrencyField() class Player(BasePlayer): join = models.StringField( choices = [['提携','提携'],['自社','自社']], label = '参入方法を選択してください。', widget = widgets.RadioSelectHorizontal, ) def other_player(self): return self.get_others_in_group()[0] units_1= models.StringField( choices = [['2','2'],['3','3'],['4','4'],['5','5']], label = '生産量Aの選択', widget = widgets.RadioSelectHorizontal, ) def other_player(self): return self.get_others_in_group()[0] units_2= models.StringField( choices = [['2','2'],['3','3'],['4','4'],['5','5']], label = '生産量Bの選択', widget = widgets.RadioSelectHorizontal, ) def other_player(self): return self.get_others_in_group()[0] points_1 = models.CurrencyField( label = '生産量Aのポイントを記入してください。(半角)' ) points_2 = models.CurrencyField( label = '生産量Bのポイントを記入してください。(半角)' )