from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants class Results(Page): form_model = 'player' def vars_for_template(self): me = self.participant.vars['first'] mes = self.participant.vars['second'] op = self.participant.vars['ofirst'] ops = self.participant.vars['osecond'] be = self.participant.vars['belief'] bes = self.participant.vars['beliefs'] exp = Constants.expected_cooperators exps = Constants.expected_cooperators2 return dict( my_decision=me, op_decision=op, same_choice=me == op, my_belief=be, correct_belief= be==exp, mys_decision=mes, ops_decision=ops, sames_choice=mes == ops, my_beliefs=bes, correct_beliefs= bes==exps, expectation= exp, expectations= exps ) class Redirect(Page): form_model = 'player' page_sequence = [Results, Redirect]