from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants class WaitingForStart(WaitPage): wait_for_all_groups = True def is_displayed(self): return self.round_number == 1 class Instructions(Page): form_model = 'player' def is_displayed(self): return self.round_number == 1 class WaitingForStart2(WaitPage): wait_for_all_groups = True def is_displayed(self): return self.round_number == 1 class ControlQuestion(Page): form_model = 'player' form_fields = ['QuestionPG', 'Questionme'] def is_displayed(self): return self.round_number == 1 class Results(Page): form_model = 'player' def is_displayed(self): return self.round_number == 1 class Start(Page): form_model = 'player' def is_displayed(self): return self.round_number == 1 class Info(Page): form_model = 'player' form_fields = ['Info'] def is_displayed(self): return self.round_number != 1 class ExtractionUmpire(WaitPage): def is_displayed(self): return self.round_number != 1 def after_all_players_arrive(self): self.group.umpire() class RandomGroup(WaitPage): def is_displayed(self): return self.round_number != 1 def after_all_players_arrive(self): self.group.randomgroup() class ElaboratingInfoGruppi(WaitPage): wait_for_all_groups = True def is_displayed(self): return self.round_number != 1 def after_all_players_arrive(self): self.subsession.contribuzioni_gruppi_precedenti() class ElaboratingInfoPunizioni(WaitPage): wait_for_all_groups = True def is_displayed(self): return self.round_number != 1 def after_all_players_arrive(self): self.subsession.punizioni_gruppi_precedenti() class ElaoratinginfoCorruzione(WaitPage): wait_for_all_groups = True def is_displayed(self): return self.round_number != 1 def after_all_players_arrive(self): self.subsession.corruzioneprima() class ElaboratinginfoCorruttori(WaitPage): wait_for_all_groups = True def is_displayed(self): return self.round_number != 1 def after_all_players_arrive(self): self.subsession.corruttoriprima() class MyWaitPage(WaitPage): wait_for_all_groups = True def is_displayed(self): return self.round_number != 1 def after_all_players_arrive(self): self.subsession.my_method2() class DiscoveryUmpire(Page): form_model = 'player' def is_displayed(self): return self.player.Info == True class Contribution(Page): form_model = 'player' form_fields = ['contribution'] class Giocatori(WaitPage): def after_all_players_arrive(self): self.group.after_all_players_arrive() class ExecutingPayoffRound1(WaitPage): def is_displayed(self): return self.round_number == 1 def after_all_players_arrive(self): self.group.set_payoff1() class Punizioni(WaitPage): def after_all_players_arrive(self): self.group.punizioni_gruppi() class Giocate(WaitPage): def after_all_players_arrive(self): self.group.giocate() class GiocateSubsessiom(WaitPage): wait_for_all_groups = True def after_all_players_arrive(self): self.subsession.contribuzioni_gruppi() class MyWaitPage2(WaitPage): def after_all_players_arrive(self): self.group.partecip() class MyWaitPage3(WaitPage): wait_for_all_groups = True def after_all_players_arrive(self): self.subsession.my_method() class PayoffRound1(Page): form_model = 'player' def is_displayed(self): return self.round_number == 1 def before_next_page(self): self.player.setglobals() class ExecutingPayoff2(WaitPage): def is_displayed(self): return self.round_number != 1 and self.player.umpire == 0 def after_all_players_arrive(self): self.group.set_payoffONEST() class ExecutingPayoff3(WaitPage): def is_displayed(self): return self.round_number != 1 and self.player.umpire == 1 def after_all_players_arrive(self): self.group.set_payoffCORRUPT() class Payoff2(Page): form_model = 'player' def is_displayed(self): return self.round_number != 1 def before_next_page(self): self.player.setglobals() class Corrgruppi(WaitPage): def after_all_players_arrive(self): self.group.corr() class Corruttori(WaitPage): wait_for_all_groups = True def after_all_players_arrive(self): self.subsession.corruttori() class Corruzione(WaitPage): wait_for_all_groups = True def after_all_players_arrive(self): self.subsession.corruzione() class Punizioni2(WaitPage): def is_displayed(self): return self.round_number != 1 def after_all_players_arrive(self): self.group.punizioni_gruppi() class PunizioniSubsession(WaitPage): wait_for_all_groups = True def after_all_players_arrive(self): self.subsession.punizioni() class Ringraziamento(Page): form_model = 'player' def is_displayed(self): return self.round_number == 10 page_sequence = [WaitingForStart, Instructions, WaitingForStart2, ControlQuestion, Results, Start, Info, ExtractionUmpire, RandomGroup, ElaboratingInfoGruppi, ElaboratingInfoPunizioni, ElaoratinginfoCorruzione, ElaboratinginfoCorruttori, MyWaitPage, DiscoveryUmpire, Contribution, Giocatori, ExecutingPayoffRound1, Punizioni, Giocate, GiocateSubsessiom, MyWaitPage2, MyWaitPage3, PayoffRound1, ExecutingPayoff2, ExecutingPayoff3, Payoff2, Corrgruppi, Corruttori, Corruzione, Punizioni2, PunizioniSubsession, Ringraziamento]