from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range, ) author = 'David Lucius' doc = """ created by: David Lucius (david.lucius@posteo.de) """ class Constants(BaseConstants): name_in_url = 'PICTURES' players_per_group = None num_rounds = 20 images = { 1: ['Bark 2', 'Bark 5', 'Cardboard 1', 'Cotton swabs 2', 'Cups 1', 'Dirt 3', 'Fire hydrant 2', 'Office supplies 2', 'Paintbrush 1', 'Paper 2', 'Paper 4', 'Paperclips 4', 'Pinecone 2', 'Rocks 6', 'Roofing 1', 'Roofing 5', 'Socks 1', 'Timber 2', 'Wall 2', 'Yarn 3'], 2: ['Bark 3', 'Bricks 1', 'Cardboard 2', 'Cotton swabs 3', 'Cups 2', 'Dirt 4', 'Office supplies 1', 'Office supplies 5', 'Paper 1', 'Paper 3', 'Paperclips 3', 'Pinecone 1', 'Rocks 2', 'Rocks 7', 'Roofing 2', 'Sidewalk 5', 'Storage 1', 'Wall 1', 'Wall 3', 'Yarn 4'], 3: ['Animal carcass 5', 'Bloody knife 1', 'Car crash 3', 'Cockroach 1', 'Destruction 6', 'Dog 26', 'Dummy 1', 'Explosion 6', 'Fire 7', 'Flood 1', 'Frustrated pose 1', 'Injury 2', 'KKK rally 1', 'Neonazi 1', 'Plane crash 3', 'Police 2', 'Sad face 9', 'Shot 3', 'Tornado 1', 'War 6'], 4: ['Animal carcass 6', 'Car accident 1', 'Cemetery 5', 'Cockroach 2', 'Dog 24', 'Dog 31', 'Explosion 2', 'Fire 2', 'Fire 11', 'Flood 3', 'Injury 1', 'Injury 3', 'KKK rally 2', 'Plane crash 1', 'Plane crash 4', 'Police 5', 'Scary face 1', 'Snake 4', 'War 1', 'War 8'], 5: ['Baby 1', 'Baby 4', 'Beach 2', 'Cat 3', 'Couple 4', 'Dog 2', 'Dog 12', 'Dog 18', 'Elephant 1', 'Father 1', 'Fireworks 2', 'Flowers 9', 'Lake 5', 'Lake 12', 'Lake 15', 'Mother 1', 'Mother 6', 'Nature 1', 'Rainbow 1', 'Sunset 2'], 6: ['Baby 3', 'Beach 1', 'Beach 7', 'Cat 5', 'Couple 7', 'Dog 6', 'Dog 14', 'Dog 19', 'Excited face 2', 'Fireworks 1', 'Fireworks 3', 'Galaxy 7', 'Lake 9', 'Lake 14', 'Lake 16', 'Mother 4', 'Mother 7', 'Penguins 2', 'Rainbow 2', 'Sunset 4'] } class Subsession(BaseSubsession): def creating_session(self): for p in self.get_players(): p.image_name = Constants.images[p.id_in_group][self.round_number - 1] class Group(BaseGroup): pass class Player(BasePlayer): # Screen: Image image_name = models.StringField() feelings_description = models.LongStringField() # Screen: Evaluation feelings_rating = models.IntegerField( choices=[[i, str(i)] for i in range(1, 8)], widget=widgets.RadioSelectHorizontal )