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 = 'Quiz2' players_per_group = None num_rounds = 10 # 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.', 'You are a buyer matched with both sellers. If both sellers accept:', 'True or False: If a buyer has made a proposal to both you and the other seller and you accept, you will always trade.'] question_choices = [['True','False'], ['50','20','0'], ['30', '20', '0'], ['True', 'False'], ['True', 'False'], ['True', 'False'], ['True', 'False'], ['True', 'False'], ['Both sellers will trade with you','The seller with the highest cost will trade with you','The seller with the lowest cost will trade with you','The seller with priority will trade with you.'], ['True', 'False']] correct_answers = ['False', '20', '30', 'False','True','False','False','False','The seller with priority will trade with you.','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 periods so the total number of markets completed does not matter.', 'You can choose to make an offer that your counterparty (or counterparties) cannot accept if you do not want to trade with them.', 'If multiple sellers accept, the trade will be with whichever seller has priority.', 'It depends on whether or not you have priority. If the other seller has priority, he or she will trade instead of you.'] 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]