from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants,Player class QuestionnairePage(Page): form_model = 'player' #form_fields = ['age'] form_fields = ['age', 'gender', 'sibling_number', 'program', 'potential_major','year_of_program','previous_experiments', 'city', 'importance_religion','volunteer_work','ease_of_instruction','hard_to_follow_instructions','familiarity_with_music', 'communication_with_group','helpfulness_of_communication','attachment_level','dictator_strategy_2people','dictator_strategy_3people','group_dynamic_influence'] def before_next_page(self): pass # self.participant.vars['scl_payoff'] = 40 # self.participant.vars['the_dictator_payoff'] = 80 # self.participant.vars['group_enhancing_payoff'] = [100,0] class Results(Page): def vars_for_template(self): print(self.participant.vars) final_payoff = 200 + self.participant.vars['scl_payoff'] + self.participant.vars['the_dictator_payoff'] + self.participant.vars['group_enhancing_payoff'][0] + self.participant.vars['group_enhancing_payoff'][1] self.participant.payoff = final_payoff + 200 return {'final_payoff' : final_payoff} pass class FinalPage(Page): pass page_sequence = [ QuestionnairePage, Results, FinalPage, ]