from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) author = 'oTree Team' doc = """ A quiz for the collateral game """ class Constants(BaseConstants): treatment = 'treatment1' name_in_url = 'collateral_quiz' players_per_group = None num_rounds = 1 question_one_solution = True question_two_solution = 1 question_three_solution = 1 question_four_solution = 4 if treatment == 'treatment1' or treatment == 'treatment2': question_five_solution = 2 else: question_five_solution = 1 question_six_solution = 3 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): num_correct = models.IntegerField(initial=0) question_one_response = models.BooleanField(initial=False, verbose_name='', widget=widgets.RadioSelect, choices=[ [True, 'a. True'], [False, 'b. False'], ] ) question_two_response = models.IntegerField(verbose_name='',widget=widgets.RadioSelect,choices=[ [1, 'a. The lender offers a repayment rate, the borrower offers collateral, the lender offers a loan, the borrower accepts the loan agreement'], [2, 'b. The lender offers a loan and a repayment rate, the borrower offers collateral, the lender accepts the loan agreement'], [3, 'c. The borrower offers a repayment rateand collateral, the lender offers a loan, the borrower accepts the loan agreement'], [4, 'd. The borrower offers collateral, the lender offers the loan, the borrower offers a repayment rate, and the lender accepts the loan agreement'], ] ) question_three_response = models.IntegerField(verbose_name='',widget=widgets.RadioSelect, choices=[ [1, 'a. 0-10'], [2, 'b. 1-10'], [3, 'c. 1-5'], [4, 'd. 5-10'], ] ) question_four_response = models.IntegerField(verbose_name='',widget=widgets.RadioSelect, choices=[ [1, 'a. 1.5'], [2, 'b. 2'], [3, 'c. 2.5'], [4, 'd. 3'], [5, 'e. 4'], ] ) question_five_response = models.IntegerField(verbose_name='',widget=widgets.RadioSelect, choices=[ [1, 'a. A contractual algorithm '], [2, 'b. The lender'], [3, 'c. The borrower'], ] ) question_six_response = models.IntegerField(verbose_name='',widget=widgets.RadioSelect, choices=[ [1, 'a. The lender obtains the full value of the collateral'], [2, 'b. The lender can obtain additional points from the borrower’s project return'], [3, 'c. The lender can obtain some value from the collateral up to the value minus the collateral fee'], [4, 'd. The lender cannot obtain any additional compensation'], ] ) q1_incorrect_attempts = models.IntegerField(initial=0) q2_incorrect_attempts = models.IntegerField(initial=0) q3_incorrect_attempts = models.IntegerField(initial=0) q4_incorrect_attempts = models.IntegerField(initial=0) q5_incorrect_attempts = models.IntegerField(initial=0) q6_incorrect_attempts = models.IntegerField(initial=0) q1_answered = models.BooleanField(initial=False) q2_answered = models.BooleanField(initial=False) q3_answered = models.BooleanField(initial=False) q4_answered = models.BooleanField(initial=False) q5_answered = models.BooleanField(initial=False) q6_answered = models.BooleanField(initial=False) quiz_earnings = models.CurrencyField(initial=0)