from otree.api import Currency as c, currency_range from . import models from ._builtin import Page, WaitPage from .models import Constants from otreeutils.pages import UnderstandingQuestionsPage class Quiz(UnderstandingQuestionsPage): template_name = 'attention/test.html' form_model = models.Player form_field_n_wrong_attempts = 'understanding_questions_wrong_attempts' #set_correct_answers = True def get_questions(self): treatment = self.participant.vars['treatment_info'] # in settings #eff only = 2 #O+E = 1 #Outcome only = 0 # in choices # O+E = 0 # Outcome only = 1 # Effort only = 2 if treatment == 0: treatment_translated=1 if treatment == 1: treatment_translated=0 if treatment == 2: treatment_translated=2 choices=['Both the company profit level AND how many winning balls the employee bought', 'Only the company profit level (HIGH or LOW)',' Only how many winning balls the employee bought'] questions = [ { 'question': 'At the end of the session, a participant has earned 400 points. How many USD will he receive as a payoff?', 'options': [1,2,3,4], 'correct': 2, 'hint': 'The "Introduction" section of the instructions will help you answer this question. Please try answering the question again' }, { 'question': 'How will your total payoff be determined?', 'options': ['One period is randomly chosen as a payoff period', 'The total payoff of all the six periods', 'My compensation in this study is fixed'], 'correct': 'One period is randomly chosen as a payoff period', 'hint': 'The "Introduction" section of the instructions will help you answer this question. Please try answering the question again', }, { 'question': 'Will you interact with the same person (employee/supervisor) for all the periods of the study?', 'options': ['Yes','No'], 'correct': 'Yes', 'hint': 'The "Introduction" section of the instructions will help you answer this question. Please try answering the question again' }, { 'question': 'If the employee does not buy any winning balls, how many winning balls will there be in the bag?', 'options': [0, 2, 4, 8], 'correct': 2, 'hint': 'The "Employee decides how many winning balls to buy" section of the instructions will help you answer this question. Please try answering the question again' }, { 'question': 'How much does it cost the employee to buy 3 winning balls?', 'options': [0, 30, 60, 90], 'correct': 60, 'hint': 'The "Employee decides how many winning balls to buy" section of the instructions will help you answer this question. Please try answering the question again' }, { 'question': 'What is the maximum number of additional winning balls that an employee can buy?', 'options': [2, 5, 8, 10], 'correct': 5, 'hint': 'The "Employee decides how many winning balls to buy" section of the instructions will help you answer this question. Please try answering the question again' }, { 'question': 'What is the probability of a HIGH profit if the employee buys 2 winning balls?', 'options': ['20%', '30%', '40%', '80%'], 'correct': '40%', 'hint': 'The "Employee decides how many winning balls to buy" section of the instructions will help you answer this question. Please try answering the question again' }, { 'question': 'What do the reports presented to the supervisor when they make their bonus decision every period contain?', 'options': choices, 'correct': choices[treatment_translated], 'hint': 'The "Supervisor decides the bonus for the employee" section of the instructions will help you answer this question. Please try answering the question again' }, { 'question': "How much would a supervisor's payoff decrease in a period where the supervisor gave the employee a bonus of 150 points instead of a bonus of 100 points?", 'options': ["The supervisor's payoff would decrease by 50 points because supervisors pay the bonus out of their own pocket","The supervisor's payoff would not decrease at all because supervisors do not pay the bonus out of their own pocket"], 'correct': "The supervisor's payoff would not decrease at all because supervisors do not pay the bonus out of their own pocket", 'hint': 'The "Supervisor decides the bonus for the employee" section of the instructions will help you answer this question. Please try answering the question again' }, { 'question': 'If an employee decides to confront their supervisor, how will the payoffs for that period be affected?', 'options': ['30 points will be deducted from the supervisor','30 points will be deducted from the supervisor and 10 points will be deducted from the employee'], 'correct': '30 points will be deducted from the supervisor and 10 points will be deducted from the employee', 'hint': 'The "Employee decides if they confront the supervisor" section of the instructions will help you answer this question. Please try answering the question again' }, { 'question': 'Will supervisors know if they were confronted by the employee?', 'options': ['Yes','No'], 'correct': 'Yes', 'hint': 'The "Supervisor decides the bonus for the employee" section of the instructions will help you answer this question. Please try answering the question again' }, { 'question': 'What is the payoff of a supervisor in a period in which profit is HIGH and the employee did not confront the supervisor? (Don’t forget that supervisors also receive a salary each period)', 'options': [280,380,440,590], 'correct': 590, 'hint': 'The "Payoff summary" section of the instructions will help you answer this question. Please try answering the question again' }, { 'question': 'What is the payoff of an employee in a period in which they bought 3 winning balls, the bonus was 100 and the employee did not confront the supervisor? (Don’t forget that employees also receive a salary each period)', 'options': [280,400,440,540], 'correct': 400, 'hint': 'The "Payoff summary" section of the instructions will help you answer this question. Please try answering the question again' }, ] return questions def is_displayed(self): return not('skip_quiz' in self.session.config) def app_after_this_page(self, upcoming_apps): if self.player.understanding_questions_wrong_attempts>4: self.participant.vars["quiz_fail"]=True return "kicked_out" class Instructions_text(Page): def vars_for_template(self): self.player.ip=self.request.META['REMOTE_ADDR'] return dict( treatment_info=self.participant.vars['treatment_info'], ) page_sequence = [ Instructions_text, Quiz, ]