from otree.api import (
    models,
    widgets,
    BaseConstants,
    BaseSubsession,
    BaseGroup,
    BasePlayer,
    Currency as c,
    currency_range,
)

doc = """
author = 'Wael Bousselmi'
Exp E4C
"""


class Constants(BaseConstants):
    name_in_url = 'exp_e4c_fr_questionnaire_v2'
    players_per_group = 2
    num_rounds = 1

    showupfee = 0


class Subsession(BaseSubsession):

    def vars_for_admin_report(self):
        report = list()
        for p in self.get_players():
            report.append(dict(id=p.participant.id_in_session,
                               label=p.participant.label,
                               ))
        return dict(report=report)

class Group(BaseGroup):
    pass



class Player(BasePlayer):

    def role(self):
        return {1: 'A', 2: 'B'}[self.id_in_group]

    q_1 = models.IntegerField(
        choices=[
            [0, '0%'],
            [1, '10%'],
            [2, '20%'],
            [3, '30%'],
            [4, '40%'],
            [5, '50%'],
            [6, '60%'],
            [7, '70%'],
            [8, '80%'],
            [9, '90%'],
            [10, '100%'],
        ],
        widget=widgets.RadioSelectHorizontal,
        label="",
        blank=False
    )

    q_2_a = models.IntegerField(
        choices=[
            [1, '1'],
            [2, '2'],
            [3, '3'],
            [4, '4'],
            [5, '5'],
            [6, '6'],
        ],
        widget=widgets.RadioSelectHorizontal,
        label="",
        blank=False
    )


    q_2_b = models.IntegerField(
        choices=[
            [1, '1'],
            [2, '2'],
            [3, '3'],
            [4, '4'],
            [5, '5'],
            [6, '6'],
        ],
        widget=widgets.RadioSelectHorizontal,
        label="",
        blank=False
    )

    q_2_c = models.IntegerField(
        choices=[
            [1, '1'],
            [2, '2'],
            [3, '3'],
            [4, '4'],
            [5, '5'],
            [6, '6'],
        ],
        widget=widgets.RadioSelectHorizontal,
        label="",
        blank=False
    )



    q_2_e = models.IntegerField(
        choices=[
            [1, '1'],
            [2, '2'],
            [3, '3'],
            [4, '4'],
            [5, '5'],
            [6, '6'],
        ],
        widget=widgets.RadioSelectHorizontal,
        label="",
        blank=False
    )

    q_2_f = models.IntegerField(
        choices=[
            [1, '1'],
            [2, '2'],
            [3, '3'],
            [4, '4'],
            [5, '5'],
            [6, '6'],
        ],
        widget=widgets.RadioSelectHorizontal,
        label="",
        blank=False
    )

    q_2_g = models.IntegerField(
        choices=[
            [1, '1'],
            [2, '2'],
            [3, '3'],
            [4, '4'],
            [5, '5'],
            [6, '6'],
        ],
        widget=widgets.RadioSelectHorizontal,
        label="",
        blank=False
    )

    q_2_h = models.StringField(
        label="",
        blank=True
    )

    q_3 = models.IntegerField(
        choices=[
            [1, '1 - Jamais'],
            [2, '2 - Rarement'],
            [3, '3 - Souvent'],
            [4, '4 - Très souvent'],
        ],
        widget=widgets.RadioSelect,
        label="",
        blank=False
    )

    q_4 = models.IntegerField(
        choices=[
            [1, '1'],
            [2, '2'],
            [3, '3'],
            [4, '4'],
            [5, '5'],
            [6, '6'],
        ],
        widget=widgets.RadioSelectHorizontal,
        label="",
        blank=False
    )
    q_5 = models.IntegerField(
        choices=[
            [1, '1'],
            [2, '2'],
            [3, '3'],
            [4, '4'],
            [5, '5'],
            [6, '6'],
        ],
        widget=widgets.RadioSelectHorizontal,
        label="",
        blank=False
    )

    q_6 = models.IntegerField(
        choices=[
            [1, '1 - Jamais'],
            [2, '2 - Rarement'],
            [3, '3 - Souvent'],
            [4, '4 - Toujours'],
            [5, '5 - Je ne bois pas de café (thé) à l’école / au travail'],
        ],
        widget=widgets.RadioSelect,
        label="",
        blank=False
    )

    q_7 = models.IntegerField(
        choices=[
            [1, '1 - Jamais'],
            [2, '2 - Rarement'],
            [3, '3 - Souvent'],
            [4, '4 - Toujours'],
        ],
        widget=widgets.RadioSelect,
        label="",
        blank=False
    )

    q_8 = models.IntegerField(
        choices=[
            [1, '1 - Jamais'],
            [2, '2 - Rarement'],
            [3, '3 - Souvent'],
            [4, '4 - Toujours'],
        ],
        widget=widgets.RadioSelect,
        label="",
        blank=False
    )

    q_9 = models.IntegerField(
        choices=[
            [1, '1 - Jamais'],
            [2, '2 - Rarement'],
            [3, '3 - Souvent'],
            [4, '4 - Toujours'],
        ],
        widget=widgets.RadioSelect,
        label="",
        blank=False
    )

    q_10 = models.IntegerField(
        choices=[
            [1, '1 - Jamais'],
            [2, '2 - Rarement'],
            [3, '3 - Souvent'],
            [4, '4 - Toujours'],
        ],
        widget=widgets.RadioSelect,
        label="",
        blank=False
    )

    q_11 = models.IntegerField(
        choices=[
            [1, '1 - Jamais'],
            [2, '2 - Rarement'],
            [3, '3 - Souvent'],
            [4, '4 - Toujours'],
        ],
        widget=widgets.RadioSelect,
        label="",
        blank=False
    )

    q_12 = models.IntegerField(
        choices=[
            [1, '1 - Jamais'],
            [2, '2 - Rarement'],
            [3, '3 - Souvent'],
            [4, '4 - Toujours'],
            [5, '5 - Je n’utilise pas de piles'],
        ],
        widget=widgets.RadioSelect,
        label="",
        blank=False
    )

    q_13 = models.IntegerField(
        choices=[
            [1, '1 - Jamais'],
            [2, '2 - Rarement'],
            [3, '3 - Souvent'],
            [4, '4 - Toujours'],
        ],
        widget=widgets.RadioSelect,
        label="",
        blank=False
    )

    q_14 = models.IntegerField(
        choices=[
            [1, '1 - Jamais'],
            [2, '2 - Rarement'],
            [3, '3 - Souvent'],
            [4, '4 - Toujours'],
        ],
        widget=widgets.RadioSelect,
        label="",
        blank=False
    )

    q_15 = models.IntegerField(
        choices=[
            [1, '1 - Jamais'],
            [2, '2 - Rarement'],
            [3, '3 - Souvent'],
            [4, '4 - Toujours'],
        ],
        widget=widgets.RadioSelect,
        label="",
        blank=False
    )

    q_16 = models.IntegerField(
        choices=[
            [1, '1 - Jamais'],
            [2, '2 - Rarement'],
            [3, '3 - Souvent'],
            [4, '4 - Toujours'],
        ],
        widget=widgets.RadioSelect,
        label="",
        blank=False
    )

    q_17 = models.IntegerField(
        choices=[
            [1, '1 - Jamais'],
            [2, '2 - Rarement'],
            [3, '3 - Souvent'],
            [4, '4 - Toujours'],
        ],
        widget=widgets.RadioSelect,
        label="",
        blank=False
    )

    q_18 = models.IntegerField(
        choices=[
            [1, '1 - Jamais'],
            [2, '2 - Rarement'],
            [3, '3 - Souvent'],
            [4, '4 - Toujours'],
        ],
        widget=widgets.RadioSelect,
        label="",
        blank=False
    )

    q_19 = models.IntegerField(
        choices=[
            [1, '1'],
            [2, '2'],
            [3, '3'],
            [4, '4'],
            [5, '5'],
            [6, '6'],
        ],
        widget=widgets.RadioSelectHorizontal,
        label="",
        blank=False
    )

    q_20 = models.IntegerField(
        choices=[
            [1, '1 - Jamais'],
            [2, '2 - Rarement'],
            [3, '3 - Souvent'],
            [4, '4 - Toujours'],
        ],
        widget=widgets.RadioSelect,
        label="",
        blank=False
    )
    q_20_a = models.IntegerField(
        label="",
        blank=True
    )

    q_20_b = models.StringField(
        label="",
        blank=True
    )

    q_21 = models.IntegerField(
        choices=[
            [1, 'a-	Green (100% électrique ou hybride) (à 26 € la course)'],
            [2, 'b-	UberX (Économique, rapide et fiable) (à 22€ la course)'],
            [3, 'c-	Comfort (Véhicules spacieux et chauffeurs les mieux notés) (à 30€ la course)'],
        ],
        widget=widgets.RadioSelect,
        label="",
        blank=False
    )

    q_22 = models.IntegerField(
        choices=[
            [1, '1'],
            [2, '2'],
            [3, '3'],
            [4, '4'],
            [5, '5'],
            [6, '6'],
        ],
        widget=widgets.RadioSelectHorizontal,
        label="",
        blank=False
    )

    q_23 = models.IntegerField(
        choices=[
            [1, '1'],
            [2, '2'],
            [3, '3'],
            [4, '4'],
            [5, '5'],
            [6, '6'],
        ],
        widget=widgets.RadioSelectHorizontal,
        label="",
        blank=False
    )

    q_24 = models.IntegerField(
        choices=[
            [1, '1 - Jamais'],
            [2, '2 - Rarement'],
            [3, '3 - Souvent'],
            [4, '4 - Toujours'],
            [5, '5 - Je ne conduis pas'],
        ],
        widget=widgets.RadioSelect,
        label="",
        blank=False
    )

    q_25 = models.IntegerField(
        choices=[
            [1, '1'],
            [2, '2'],
            [3, '3'],
            [4, '4'],
            [5, '5'],
            [6, '6'],
        ],
        widget=widgets.RadioSelectHorizontal,
        label="",
        blank=False
    )

    q_26 = models.IntegerField(
        choices=[
            [1, '1 - Jamais'],
            [2, '2 - Rarement'],
            [3, '3 - Souvent'],
            [4, '4 - Toujours'],
        ],
        widget=widgets.RadioSelect,
        label="",
        blank=False
    )

    q_27 = models.IntegerField(
        choices=[
            [1, '1 - Jamais'],
            [2, '2 - Rarement'],
            [3, '3 - Souvent'],
            [4, '4 - Toujours'],
        ],
        widget=widgets.RadioSelect,
        label="",
        blank=False
    )

    q_28 = models.IntegerField(
        choices=[
            [0, 'Oui'],
            [1, 'Non'],
        ],
        widget=widgets.RadioSelect,
        label="",
        blank=False
    )

    q_28_a = models.StringField(
        label="Si oui, laquelle ? ",
        blank=True
    )

    q_29 = models.IntegerField(
        choices=[
            [1, '1'],
            [2, '2'],
            [3, '3'],
            [4, '4'],
            [5, '5'],
            [6, '6'],
        ],
        widget=widgets.RadioSelectHorizontal,
        label="",
        blank=False
    )
    q_30_a = models.IntegerField(
        choices=[
            [1, '1'],
            [2, '2'],
            [3, '3'],
            [4, '4'],
            [5, '5'],
            [6, '6'],
            [7, '7'],
            [8, '8'],
            [9, '9'],
            [10, '10'],
        ],
        widget=widgets.RadioSelectHorizontal,
        label="",
        blank=False
    )

    q_30_b = models.IntegerField(
        choices=[
            [1, '1'],
            [2, '2'],
            [3, '3'],
            [4, '4'],
            [5, '5'],
            [6, '6'],
            [7, '7'],
            [8, '8'],
            [9, '9'],
            [10, '10'],
        ],
        widget=widgets.RadioSelectHorizontal,
        label="",
        blank=False
    )

    q_30_c = models.IntegerField(
        choices=[
            [1, '1'],
            [2, '2'],
            [3, '3'],
            [4, '4'],
            [5, '5'],
            [6, '6'],
            [7, '7'],
            [8, '8'],
            [9, '9'],
            [10, '10'],
        ],
        widget=widgets.RadioSelectHorizontal,
        label="",
        blank=False
    )

    q_30_d = models.IntegerField(
        choices=[
            [1, '1'],
            [2, '2'],
            [3, '3'],
            [4, '4'],
            [5, '5'],
            [6, '6'],
            [7, '7'],
            [8, '8'],
            [9, '9'],
            [10, '10'],
        ],
        widget=widgets.RadioSelectHorizontal,
        label="",
        blank=False
    )

    q_31 = models.IntegerField()

    q_32 = models.IntegerField(
        choices=[
            [0, 'Oui'],
            [1, 'Non'],
        ],
        widget=widgets.RadioSelect,
        label="",
        blank=False
    )

    q_33_a = models.IntegerField(
        choices=[
            [1, '1'],
            [2, '2'],
            [3, '3'],
            [4, '4'],
            [5, '5'],
            [6, '6'],
        ],
        widget=widgets.RadioSelectHorizontal,
        label="",
        blank=False
    )

    q_33_b = models.IntegerField(
        choices=[
            [1, '1'],
            [2, '2'],
            [3, '3'],
            [4, '4'],
            [5, '5'],
            [6, '6'],
        ],
        widget=widgets.RadioSelectHorizontal,
        label="",
        blank=False
    )

    q_33_c = models.IntegerField(
        choices=[
            [1, '1'],
            [2, '2'],
            [3, '3'],
            [4, '4'],
            [5, '5'],
            [6, '6'],
        ],
        widget=widgets.RadioSelectHorizontal,
        label="",
        blank=False
    )

    q_33_d = models.IntegerField(
        choices=[
            [1, '1'],
            [2, '2'],
            [3, '3'],
            [4, '4'],
            [5, '5'],
            [6, '6'],
        ],
        widget=widgets.RadioSelectHorizontal,
        label="",
        blank=False
    )

    q_33_e = models.IntegerField(
        choices=[
            [1, '1'],
            [2, '2'],
            [3, '3'],
            [4, '4'],
            [5, '5'],
            [6, '6'],
        ],
        widget=widgets.RadioSelectHorizontal,
        label="",
        blank=False
    )

    q_33_f = models.IntegerField(
        choices=[
            [1, '1'],
            [2, '2'],
            [3, '3'],
            [4, '4'],
            [5, '5'],
            [6, '6'],
        ],
        widget=widgets.RadioSelectHorizontal,
        label="",
        blank=False
    )

    q_34 = models.IntegerField(
        choices=[
            [1, '1'],
            [2, '2'],
            [3, '3'],
            [4, '4'],
            [5, '5'],
            [6, '6'],
        ],
        widget=widgets.RadioSelectHorizontal,
        label="",
        blank=False
    )

    q_35 = models.IntegerField(
        choices=[
            [1, '1'],
            [2, '2'],
            [3, '3'],
            [4, '4'],
            [5, '5'],
            [6, '6'],
        ],
        widget=widgets.RadioSelectHorizontal,
        label="",
        blank=False
    )

    q_37 = models.IntegerField(
        choices=[
            [1, '1'],
            [2, '2'],
            [3, '3'],
            [4, '4'],
            [5, '5'],
            [6, '6'],
        ],
        widget=widgets.RadioSelectHorizontal,
        label="",
        blank=False
    )

    q_38_a = models.IntegerField(
        choices=[
            [1, '1'],
            [2, '2'],
            [3, '3'],
            [4, '4'],
            [5, '5'],
            [6, '6'],
            [7, '7'],
            [8, '8'],
            [9, '9'],
            [10, '10'],
        ],
        widget=widgets.RadioSelectHorizontal,
        label="",
        blank=False
    )
    q_38_b = models.IntegerField(
        choices=[
            [1, '1'],
            [2, '2'],
            [3, '3'],
            [4, '4'],
            [5, '5'],
            [6, '6'],
            [7, '7'],
            [8, '8'],
            [9, '9'],
            [10, '10'],
        ],
        widget=widgets.RadioSelectHorizontal,
        label="",
        blank=False
    )
    q_38_c = models.IntegerField(
        choices=[
            [1, '1'],
            [2, '2'],
            [3, '3'],
            [4, '4'],
            [5, '5'],
            [6, '6'],
            [7, '7'],
            [8, '8'],
            [9, '9'],
            [10, '10'],
        ],
        widget=widgets.RadioSelectHorizontal,
        label="",
        blank=False
    )




