from ._builtin import Page, WaitPage from otree.api import Currency as c, currency_range from .models import Constants class Introduction(Page): """Description of the game: How to play and returns expected""" pass class Question1(Page): """Q1""" form_model = 'player' form_fields = ['feelings1'] class Waiting1(Page): timeout_seconds = 3 class victim1(Page): """You are the first victim""" pass class Question2(Page): """Q2""" form_model = 'player' form_fields = ['feelings2'] class Contribute1(Page): """Player: Choose how much to contribute and report your earning.""" form_model = 'player' form_fields = ['contribution1', 'earning1'] class ResultsWaitPage1(WaitPage): body_text = "Waiting for other participants." class Results1(Page): """Players payoff: How much each person got""" def vars_for_template(self): return dict(total_earnings=self.group.total_contribution * Constants.multiplier) class Waiting2(WaitPage): timeout_seconds = 3 class victim2(Page): """A is the second victim""" pass class Question2(Page): """Q2""" form_model = 'player' form_fields = ['feelings3'] class Contribute2(Page): """Player: Choose how much to contribute and report your earning.""" form_model = 'player' form_fields = ['contribution2', 'earning2'] class ResultsWaitPage2(WaitPage): body_text = "Waiting for other participants." timeout_seconds = 3 class Results2(Page): """Players payoff: How much each person got""" def vars_for_template(self): return dict(total_earnings=self.group.total_contribution * Constants.multiplier) class Contribute3(Page): """Player: Choose how much to contribute and report your earning.""" form_model = 'player' form_fields = ['contribution3', 'earning3'] class ResultsWaitPage3(WaitPage): body_text = "Waiting for other participants." timeout_seconds = 3 class Results3(Page): """Players payoff: How much each person got""" def vars_for_template(self): return dict(total_earnings=self.group.total_contribution * Constants.multiplier) class Contribute4(Page): """Player: Choose how much to contribute and report your earning.""" form_model = 'player' form_fields = ['contribution4', 'earning4'] class ResultsWaitPage4(WaitPage): body_text = "Waiting for other participants." timeout_seconds = 3 class Results4(Page): """Players payoff: How much each person got""" def vars_for_template(self): return dict(total_earnings=self.group.total_contribution * Constants.multiplier) class Contribute5(Page): """Player: Choose how much to contribute and report your earning.""" form_model = 'player' form_fields = ['contribution5', 'earning5'] class ResultsWaitPage5(WaitPage): body_text = "Waiting for other participants." timeout_seconds = 3 class Results5(Page): """Players payoff: How much each person got""" def vars_for_template(self): return dict(total_earnings=self.group.total_contribution * Constants.multiplier) class Stealing_points(Page): """Player can steal points""" form_model = 'player' form_fields = ['Stealing_p_leader', 'Stealing_p_A', 'Stealing_p_B'] def vars_for_template(self): return dict(Stealing_p_C = 20 - Stealing_p_leader - Stealing_p_A - Stealing_p_B) page_sequence = [Introduction, Question1, Waiting1, victim1, Question2, Contribute1, ResultsWaitPage1, Results1, Waiting2, victim2, Question2, Contribute2, ResultsWaitPage2, Results2, Contribute3, ResultsWaitPage3, Results3, Contribute4, ResultsWaitPage4, Results4, Contribute5, ResultsWaitPage5, Results5, Stealing_points]