from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) author = 'C. Lehmann & C. Haubitz' doc = """ Your app description """ class Constants(BaseConstants): name_in_url = 'simple_knapsack' players_per_group = None num_rounds = 5 #Edit the number of rounds here and in the global session variables, since the round number is important for preceeding Apps as well class Subsession(BaseSubsession): # for p in self.get_players(): # #part_drawn = composer.getRandomPart(p.participant.vars['part_set_sequence'][self.round_number-1]) # part_drawn = composer.getRandomPart(1) pass class Group(BaseGroup): pass class Player(BasePlayer): round_set_number = models.IntegerField() round_capacity = models.FloatField() round_weight = models.StringField() round_value = models.StringField() round_selection = models.StringField() total_weight = models.FloatField() total_value = models.FloatField()