from otree.api import Currency as c, currency_range
from ._builtin import Page, WaitPage
from .models import Constants

import random
import time

class BienvenueBis(Page): # version anglaise
        form_model = 'player'
        form_fields = []

        def before_next_page(self):
            self.player.game_num             = 0
            self.player.app_sequence_select  = random.randint(1,4)
            self.player.questionnaire_before = random.randint(0,1)
            self.player.participant.vars['game_num']             = self.player.game_num
            self.player.participant.vars['app_sequence_select']  = self.player.app_sequence_select
            self.player.participant.vars['questionnaire_before'] = self.player.questionnaire_before
            if self.player.app_sequence_select == 1:
                self.player.app_sequence_select_n = "gp;bw;MDG_asso;MDG_class"
            elif self.player.app_sequence_select == 2:
                self.player.app_sequence_select_n = "gp;bw;MDG_class;MDG_asso"
            elif self.player.app_sequence_select == 3:
                self.player.app_sequence_select_n = "bw;gp;MDG_asso;MDG_class"
            elif self.player.app_sequence_select == 4:
                self.player.app_sequence_select_n = "bw;gp;MDG_class;MDG_asso"
            self.player.participant.vars['app_sequence_select_n']  = self.player.app_sequence_select_n
page_sequence = [
    BienvenueBis,

]
