from otree.api import * from .models import C, Player def get_language(player): return player.session.config.get('language', 'en') == 'en' class a_Game_to_PGS(Page): def vars_for_template(player): return dict( en=get_language(player), ) class b_Personal_Information(Page): form_model = 'player' form_fields = [ 'education', 'HH_Number', 'HH_5yo', 'HH_Decision_Maker', 'Religion', 'Smoke_Cigarettes', 'Smoke_Ecig', 'Smoke_Chew', 'Smoke_Hookah', 'Drink_Alcohol', ] def vars_for_template(player): return dict( en=get_language(player), ) class c_Debt_Profile(Page): form_model = 'player' form_fields = [ 'Debt_Online_Past', 'Debt_Paylater_Credit_Past', 'Debt_Family_Past', 'Debt_Online', 'Debt_Paylater_Credit', 'Debt_Family', 'Debt_Friend', 'Debt_Private_Lender', 'Debt_Health', 'Debt_Food', 'Debt_Capital', 'Debt_A', 'Debt_B', 'Desperation_Finance', 'Quick_Money', ] def vars_for_template(player): return dict( en=get_language(player), ) class d_Financial_Literacy_1(Page): form_model = 'player' form_fields = [ 'WB_FinLit_1', 'WB_FinLit_2', 'WB_FinLit_3', 'WB_FinLit_4', 'WB_FinLit_5', ] def vars_for_template(player): return dict( en=get_language(player), ) class d_Financial_Literacy_2(Page): form_model = 'player' form_fields = [ 'OECD_FinLit_1', 'OECD_FinLit_2', 'OECD_FinLit_3', 'OECD_FinLit_4', 'OECD_FinLit_5', 'OECD_FinLit_6', 'OECD_FinLit_7', ] def vars_for_template(player): return dict( en=get_language(player), ) page_sequence = [ a_Game_to_PGS, b_Personal_Information, c_Debt_Profile, d_Financial_Literacy_1, d_Financial_Literacy_2, ]