from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants from random import * import random import time #------------------------------------- jeu6 crt class P16CRT(Page): timeout_seconds = 240 form_model = 'player' form_fields = ['crt_a', 'crt_b', 'crt_c', 'crt_d', 'crt_e', 'crt_f'] def is_displayed(self): return self.player.participant.vars['nextq0'] != 1 and self.player.participant.vars['b5'] == 1 def before_next_page(self): if self.player.crt_a == Constants.crt_correct_a: self.player.gain_crt = self.player.gain_crt + Constants.gaincrtcorrect if self.player.crt_b == Constants.crt_correct_b: self.player.gain_crt = self.player.gain_crt + Constants.gaincrtcorrect if self.player.crt_c == Constants.crt_correct_c: self.player.gain_crt = self.player.gain_crt + Constants.gaincrtcorrect if self.player.crt_d == Constants.crt_correct_d: self.player.gain_crt = self.player.gain_crt + Constants.gaincrtcorrect if self.player.crt_e == Constants.crt_correct_e: self.player.gain_crt = self.player.gain_crt + Constants.gaincrtcorrect if self.player.crt_f == Constants.crt_correct_f: self.player.gain_crt = self.player.gain_crt + Constants.gaincrtcorrect self.participant.vars['gain_crt'] = self.player.gain_crt # -------------------------------------------# new oct 2022 self.player.participant.vars['gain_jeu6'] = self.player.gain_crt # -------------------------------------------# page_sequence = [ P16CRT, ]