from otree.api import * doc = """ Your app description """ class C(BaseConstants): NAME_IN_URL = 'payment_game_calculationB' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 INSTRUCTIONS_TEMPLATE = 'payment_game_calculation/instructions.html' class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): value1 = models.PositiveIntegerField( initial=None ) value2 = models.PositiveIntegerField( initial=None ) smartphone3_wtp_calculation = models.PositiveIntegerField(verbose_name='(単位:円)', min=1,max=1000000, initial=None) smartphone3_wtp_calculationResult = models.PositiveIntegerField(verbose_name='(単位:円)', min=1,max=1000000, initial=None) applewatch3_wtp_calculation = models.PositiveIntegerField(verbose_name='(単位:円)', min=1,max=1000000, initial=None) applewatch3_wtp_calculationResult = models.PositiveIntegerField(verbose_name='(単位:円)', min=1,max=1000000, initial=None) dyson3_wtp_calculation = models.PositiveIntegerField(verbose_name='(単位:円)', min=1,max=1000000, initial=None) dyson3_wtp_calculationResult = models.PositiveIntegerField(verbose_name='(単位:円)', min=1,max=1000000, initial=None) macbook3_wtp_calculation = models.PositiveIntegerField(verbose_name='(単位:円)', min=1,max=1000000, initial=None) macbook3_wtp_calculationResult = models.PositiveIntegerField(verbose_name='(単位:円)', min=1,max=1000000, initial=None) smartphone12_wtp_calculation = models.PositiveIntegerField(verbose_name='(単位:円)', min=1,max=1000000, initial=None) smartphone12_wtp_calculationResult = models.PositiveIntegerField(verbose_name='(単位:円)', min=1,max=1000000, initial=None) applewatch12_wtp_calculation = models.PositiveIntegerField(verbose_name='(単位:円)', min=1,max=1000000, initial=None) applewatch12_wtp_calculationResult = models.PositiveIntegerField(verbose_name='(単位:円)', min=1,max=1000000, initial=None) dyson12_wtp_calculation = models.PositiveIntegerField(verbose_name='(単位:円)', min=1,max=1000000, initial=None) dyson12_wtp_calculationResult = models.PositiveIntegerField(verbose_name='(単位:円)', min=1,max=1000000, initial=None) macbook12_wtp_calculation = models.PositiveIntegerField(verbose_name='(単位:円)', min=1,max=1000000, initial=None) macbook12_wtp_calculationResult = models.PositiveIntegerField(verbose_name='(単位:円)', min=1,max=1000000, initial=None) smartphone24_wtp_calculation = models.PositiveIntegerField(verbose_name='(単位:円)', min=1,max=1000000, initial=None) smartphone24_wtp_calculationResult = models.PositiveIntegerField(verbose_name='(単位:円)', min=1,max=1000000, initial=None) applewatch24_wtp_calculation = models.PositiveIntegerField(verbose_name='(単位:円)', min=1,max=1000000, initial=None) applewatch24_wtp_calculationResult = models.PositiveIntegerField(verbose_name='(単位:円)', min=1,max=1000000, initial=None) dyson24_wtp_calculation = models.PositiveIntegerField(verbose_name='(単位:円)', min=1,max=1000000, initial=None) dyson24_wtp_calculationResult = models.PositiveIntegerField(verbose_name='(単位:円)', min=1,max=1000000, initial=None) macbook24_wtp_calculation = models.PositiveIntegerField(verbose_name='(単位:円)', min=1,max=1000000, initial=None) macbook24_wtp_calculationResult = models.PositiveIntegerField(verbose_name='(単位:円)', min=1,max=1000000, initial=None) smartphone36_wtp_calculation = models.PositiveIntegerField(verbose_name='(単位:円)', min=1,max=1000000, initial=None) smartphone36_wtp_calculationResult = models.PositiveIntegerField(verbose_name='(単位:円)', min=1,max=1000000, initial=None) applewatch36_wtp_calculation = models.PositiveIntegerField(verbose_name='(単位:円)', min=1,max=1000000, initial=None) applewatch36_wtp_calculationResult = models.PositiveIntegerField(verbose_name='(単位:円)', min=1,max=1000000, initial=None) dyson36_wtp_calculation = models.PositiveIntegerField(verbose_name='(単位:円)', min=1,max=1000000, initial=None) dyson36_wtp_calculationResult = models.PositiveIntegerField(verbose_name='(単位:円)', min=1,max=1000000, initial=None) macbook36_wtp_calculation = models.PositiveIntegerField(verbose_name='(単位:円)', min=1,max=1000000, initial=None) macbook36_wtp_calculationResult = models.PositiveIntegerField(verbose_name='(単位:円)', min=1,max=1000000, initial=None) def error_message(player, smartphone3_wtp_calculation, smartphone3_wtp_calculationResult): if smartphone3_wtp_calculationResult != smartphone3_wtp_calculation * 3: return "この答えは間違ってます。もう一度、計算してください。" #def smartphone3_wtp_calculationResult_error_message(player, smartphone3_wtp_calculationResult): #if smartphone3_wtp_calculationResult != player.smartphone3_wtp_calculation * 3: #return "この答えは間違ってます。もう一度、計算してください。" #def applewatch3_wtp_calculationResult_error_message(player, applewatch3_wtp_calculationResult): #if applewatch3_wtp_calculationResult != player.applewatch3_wtp_calculation * 3: #return "この答えは間違ってます。もう一度、計算してください。" # PAGES class Smartphone3(Page): form_model = 'player' form_fields = [ 'smartphone3_wtp_calculation', 'smartphone3_wtp_calculationResult', ] class Smartphone12(Page): form_model = 'player' form_fields = [ 'smartphone12_wtp_calculation', 'smartphone12_wtp_calculationResult', ] class Smartphone24(Page): form_model = 'player' form_fields = [ 'smartphone24_wtp_calculation', 'smartphone24_wtp_calculationResult', ] class Smartphone36(Page): form_model = 'player' form_fields = [ 'smartphone36_wtp_calculation', 'smartphone36_wtp_calculationResult', ] class applewatch3(Page): form_model = 'player' form_fields = [ 'applewatch3_wtp_calculation', 'applewatch3_wtp_calculationResult', ] class applewatch12(Page): form_model = 'player' form_fields = [ 'applewatch12_wtp_calculation', 'applewatch12_wtp_calculationResult', ] class applewatch24(Page): form_model = 'player' form_fields = [ 'applewatch24_wtp_calculation', 'applewatch24_wtp_calculationResult', ] class applewatch36(Page): form_model = 'player' form_fields = [ 'applewatch36_wtp_calculation', 'applewatch36_wtp_calculationResult', ] class dyson3(Page): form_model = 'player' form_fields = [ 'dyson3_wtp_calculation', 'dyson3_wtp_calculationResult', ] class dyson12(Page): form_model = 'player' form_fields = [ 'dyson12_wtp_calculation', 'dyson12_wtp_calculationResult', ] class dyson24(Page): form_model = 'player' form_fields = [ 'dyson24_wtp_calculation', 'dyson24_wtp_calculationResult', ] class dyson36(Page): form_model = 'player' form_fields = [ 'dyson36_wtp_calculation', 'dyson36_wtp_calculationResult', ] class macbook3(Page): form_model = 'player' form_fields = [ 'macbook3_wtp_calculation', 'macbook3_wtp_calculationResult', ] class macbook12(Page): form_model = 'player' form_fields = [ 'macbook12_wtp_calculation', 'macbook12_wtp_calculationResult', ] class macbook24(Page): form_model = 'player' form_fields = [ 'macbook24_wtp_calculation', 'macbook24_wtp_calculationResult', ] class macbook36(Page): form_model = 'player' form_fields = [ 'macbook36_wtp_calculation', 'macbook36_wtp_calculationResult', ] class instructionsA(Page): pass class instructionsB(Page): pass class ResultsWaitPage(WaitPage): pass class Results(Page): pass page_sequence = [ instructionsB, Smartphone3, applewatch3, dyson3, macbook3, Smartphone12, applewatch12, dyson12, macbook12, Smartphone24, applewatch24, dyson24, macbook24, Smartphone36, applewatch36, dyson36, macbook36, ]