from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range, ) import random import time author = 'A. Takeuchi' doc = """ Understanding test for Public goods game to avoid probablistic disaster """ class Constants(BaseConstants): name_in_url = 'understanding_test' players_per_group = None num_rounds = 1 instruction_summary = '../_templates/Instruction_Summary.html' endowment = 120 disaster_damage = 80 cost_A = 1 num_trash = 30 class Subsession(BaseSubsession): info = models.IntegerField() def get_game(self): self.info = self.session.config['info'] class Group(BaseGroup): pass class Player(BasePlayer): Problem_Q1A = models.IntegerField( initial=None, choices=[(1,'〇'), (0,'×')], verbose_name='', widget=widgets.RadioSelectHorizontal) Problem_Q1B = models.IntegerField( initial=None, choices=[(1,'〇'), (0,'×')], verbose_name='', widget=widgets.RadioSelectHorizontal) Problem_Q1C = models.IntegerField( initial=None, choices=[(1,'〇'), (0,'×')], verbose_name='', widget=widgets.RadioSelectHorizontal) Problem_Q2A = models.IntegerField( initial=None, choices=[(1,'〇'), (0,'×')], verbose_name='', widget=widgets.RadioSelectHorizontal) Problem_Q2B = models.IntegerField( initial=None, choices=[(1,'〇'), (0,'×')], verbose_name='', widget=widgets.RadioSelectHorizontal) Problem_Q2C = models.IntegerField( initial=None, choices=[(1,'〇'), (0,'×')], verbose_name='', widget=widgets.RadioSelectHorizontal) Problem_Q3A = models.IntegerField( initial=None, choices=[(1,'〇'), (0,'×')], verbose_name='', widget=widgets.RadioSelectHorizontal) Problem_Q3B = models.IntegerField( initial=None, choices=[(1,'〇'), (0,'×')], verbose_name='', widget=widgets.RadioSelectHorizontal) Problem_Q3C = models.IntegerField( initial=None, choices=[(1,'〇'), (0,'×')], verbose_name='', widget=widgets.RadioSelectHorizontal) Problem_Q4A = models.IntegerField(label='', min=-100, max=500) Problem_Q4B = models.IntegerField(label='', min=-100, max=500) Problem_Q4C = models.IntegerField(label='', min=-100, max=500)