from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) author = 'Chad Kendall' doc = """ Quiz for walras """ class Constants(BaseConstants): name_in_url = 'Quiz' players_per_group = None num_rounds = 8 # number of questions question_text = ['True or False: You match with the same group of players in every market.', 'You are a buyer with valuation 70 and agree to trade at a price of 50. Your earnings for this trade are:', 'You are a seller with a cost of 20 and agree to trade at a price of 50. Your earnings for this trade are:', 'True or False: The profit of a buyer increases with the price they pay.', 'True or False: The profit of a seller increases with the price they receive.', 'True or False: If you reject an offer, you will not earn anything for this market.', 'True or False: The more markets that are completed, the more you will earn.', 'True or False: You have to make an offer that can be accepted each time you are matched.'] question_choices = [['True','False'], ['50','20','0'], ['30', '20', '0'], ['True', 'False'], ['True', 'False'], ['True', 'False'], ['True', 'False'], ['True', 'False']] correct_answers = ['False', '20', '30', 'False','True','False','False','False'] explanation_text = ['Each market you are matched with random other players who may be the same or different.', 'Your earnings are value-price=70-50=20.', 'Your earnings are price - cost = 50 - 20 = 30.', 'The profit of a buyer is value-price so it decreases with the price.', 'The profit of a seller is price - cost so it increases with the price.', 'If you reject an offer, you may still earn points by trading in a future period.', 'You are only paid for three randomly chosen markets so the total number of markets completed does not matter.', 'You can choose to make an offer that your counterparty cannot accept if you do not want to trade with them.'] class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): answer = models.CharField(widget=widgets.RadioSelect()) # check correct answers def question_correct(self): return self.answer == Constants.correct_answers[self.round_number-1]