from otree.api import * doc = """ Your app description """ class Constants(BaseConstants): name_in_url = 'bidding_round' players_per_group = None num_rounds = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): # As the participant for the number of dollars he/she is willing to value per activity dot_user_payment = models.IntegerField(label="What is the minimum you are willing to accept to do the Dot Activity, in terms of dollars?") dot_answer = models.IntegerField(initial=0) tabooCards_user_payment = models.IntegerField(label="What is the minimum you are willing to accept to create Taboo Cards, in terms of dollars?") tabooCards_answer = models.IntegerField(initial=0) tabooGame_user_payment = models.IntegerField(label="What is the minimum you are willing to accept to do the Taboo Activity, in terms of dollars?") tabooGame_answer = models.IntegerField(initial=0) snake_user_payment = models.IntegerField(label="What is the minimum you are willing to accept to play Snake, in terms of dollars?") snake_answer = models.IntegerField(initial=0) video_user_payment = models.IntegerField(label="What is the minimum you are willing to accept to watch the Video, in terms of dollars?") video_answer = models.IntegerField(initial=0) # PAGES class InstructionsPage(Page): pass class DotPage(Page): form_model = "player" form_fields = ["dot_user_payment"] # see if the value is greater than 5 dollars via a if-else statement, where "0" is greater than 5 dollars (False) and "1" is lower than 5 dollars (True) # then store that value in "player.dot_answer" @staticmethod def before_next_page(player: Player, timeout_happened): if player.dot_user_payment > 5: player.dot_answer = 0 else: player.dot_answer = 1 # carry the value from "player.dot_answer" and allow it to be accessible from the HTML file @staticmethod def vars_for_template(player: Player): return { "player.dot_answer":player.dot_answer } class TabooCardsPage(Page): form_model = "player" form_fields = ["tabooCards_user_payment"] # see if the value is greater than 5 dollars via a if-else statement, where "0" is greater than 5 dollars (False) and "1" is lower than 5 dollars (True) # then store that value in "player.dot_answer" @staticmethod def before_next_page(player: Player, timeout_happened): if player.tabooCards_user_payment > 5: player.tabooCards_answer = 0 else: player.tabooCards_answer = 1 # carry the value from "player.dot_answer" and allow it to be accessible from the HTML file @staticmethod def vars_for_template(player: Player): return { "player.tabooCards_answer":player.tabooCards_answer } class TabooGamePage(Page): form_model = "player" form_fields = ["tabooGame_user_payment"] # see if the value is greater than 5 dollars via a if-else statement, where "0" is greater than 5 dollars (False) and "1" is lower than 5 dollars (True) # then store that value in "player.dot_answer" @staticmethod def before_next_page(player: Player, timeout_happened): if player.tabooGame_user_payment > 5: player.tabooGame_answer = 0 else: player.tabooGame_answer = 1 # carry the value from "player.dot_answer" and allow it to be accessible from the HTML file @staticmethod def vars_for_template(player: Player): return { "player.tabooGame_answer":player.tabooGame_answer } class SnakePage(Page): form_model = "player" form_fields = ["snake_user_payment"] # see if the value is greater than 5 dollars via a if-else statement, where "0" is greater than 5 dollars (False) and "1" is lower than 5 dollars (True) # then store that value in "player.dot_answer" @staticmethod def before_next_page(player: Player, timeout_happened): if player.snake_user_payment > 5: player.snake_answer = 0 else: player.snake_answer = 1 # carry the value from "player.dot_answer" and allow it to be accessible from the HTML file @staticmethod def vars_for_template(player: Player): return { "player.snake_answer":player.snake_answer } class VideoPage(Page): form_model = "player" form_fields = ["video_user_payment"] # see if the value is greater than 5 dollars via a if-else statement, where "0" is greater than 5 dollars (False) and "1" is lower than 5 dollars (True) # then store that value in "player.dot_answer" @staticmethod def before_next_page(player: Player, timeout_happened): if player.video_user_payment > 5: player.video_answer = 0 else: player.video_answer = 1 # carry the value from "player.dot_answer" and allow it to be accessible from the HTML file @staticmethod def vars_for_template(player: Player): return { "player.video_answer":player.video_answer } class Results(Page): pass page_sequence = [InstructionsPage, DotPage, TabooCardsPage, TabooGamePage, SnakePage, VideoPage, Results]