from otree.api import * doc = """ Your app description """ class Constants(BaseConstants): name_in_url = 'HLMM' players_per_group = None num_rounds = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): payout = models.IntegerField(initial=0) total_pay = models.FloatField(initial=0) ## Synonym Task Questions ## Synonym1 = models.IntegerField( choices=[ [1, "old person"], [2, "to ignite"], [3, "creditable"], [4, "desire"], ], label='1. Kindle', widget=widgets.RadioSelect, ) Synonym2 = models.IntegerField( choices=[ [1, "float"], [2, "explain"], [3, "decayed"], [4, "spin"], ], label='2. Gyrate', widget=widgets.RadioSelect, ) Synonym3 = models.IntegerField( choices=[ [1, "solitary"], [2, "short drive"], [3, "refuse"], [4, "irresistible force"], ], label='3. Jaunt', widget=widgets.RadioSelect, ) Synonym4 = models.IntegerField( choices=[ [1, "unsteady"], [2, "upcoming"], [3, "impure"], [4, "proud"], ], label='4. Imminent', widget=widgets.RadioSelect, ) Synonym5 = models.IntegerField( choices=[ [1, "arrangements"], [2, "apprehensions"], [3, "circular"], [4, "surroundings"], ], label='5. Milieus', widget=widgets.RadioSelect, ) Synonym6 = models.IntegerField( choices=[ [1, "nurturing"], [2, "neglecting"], [3, "safeguarding"], [4, "ignoring"], ], label='6. Fostering', widget=widgets.RadioSelect, ) Synonym7 = models.IntegerField( choices=[ [1, "revolt"], [2, "enforce"], [3, "track"], [4, "permanent"], ], label='7. Indelible', widget=widgets.RadioSelect, ) Synonym8 = models.IntegerField( choices=[ [1, "sharpness"], [2, "foolishness"], [3, "numbness"], [4, "intelligence"], ], label='8. Hebetude', widget=widgets.RadioSelect, ) Synonym9 = models.IntegerField( choices=[ [1, "hostile"], [2, "entangle"], [3, "fertile"], [4, "immature"], ], label='9. Fecund', widget=widgets.RadioSelect, ) Synonym10 = models.IntegerField( choices=[ [1, "study of humans"], [2, "study of nervous system"], [3, "study of birds"], [4, "study of blood"], ], label='10. Hematology', widget=widgets.RadioSelect, ) Synonym_correct = models.IntegerField(initial=0) # Jumble Task Jumble1 = models.StringField(label='NKOWN', blank=True) Jumble2 = models.StringField(label='PRPUE', blank=True) Jumble3 = models.StringField(label='NVALA', blank=True) Jumble4 = models.StringField(label='SELBL', blank=True) Jumble5 = models.StringField(label='FKCLO', blank=True) Jumble6 = models.StringField(label='CLYKU', blank=True) Jumble7 = models.StringField(label='LEYLB', blank=True) Jumble8 = models.StringField(label='NCWRO', blank=True) Jumble9 = models.StringField(label='OODSF', blank=True) Jumble10 = models.StringField(label='HSECS', blank=True) Jumble_correct = models.IntegerField(initial=0) # Letter Search Task # Letter1 = models.StringField(label='How many of the letter A do you count above', blank=True) Letter2 = models.StringField(label='How many of the letter B do you count above', blank=True) Letter3 = models.StringField(label='How many of the letter C do you count above', blank=True) Letter4 = models.StringField(label='How many of the letter D do you count above', blank=True) Letter5 = models.StringField(label='How many of the letter E do you count above', blank=True) Letter_correct = models.IntegerField(initial=0) # Addition Task # addition_correct = models.IntegerField(initial=0) addition_incorrect = models.IntegerField(initial=0) addition_attempted = models.IntegerField(initial=0) # Subtraction Task # subtract_correct = models.IntegerField(initial=0) subtract_incorrect = models.IntegerField(initial=0) subtract_attempted = models.IntegerField(initial=0) # Multiplication Task # multiply_correct = models.IntegerField(initial=0) multiply_incorrect = models.IntegerField(initial=0) multiply_attempted = models.IntegerField(initial=0) # Slider Task # slider_correct = models.IntegerField(initial=0) slider_incorrect = models.IntegerField(initial=0) slider_attempted = models.IntegerField(initial=0) # Word Search Task # Word1 = models.StringField(label="", blank=False, max_length=5) Word2 = models.StringField(label="", blank=True, max_length=5) Word3 = models.StringField(label="", blank=True, max_length=5) Word4 = models.StringField(label="", blank=True, max_length=5) Word5 = models.StringField(label="", blank=False, max_length=5) Word6 = models.StringField(label="", blank=True, max_length=5) Word7 = models.StringField(label="", blank=True, max_length=5) Word8 = models.StringField(label="", blank=True, max_length=5) Word9 = models.StringField(label="", blank=False, max_length=5) Word10 = models.StringField(label="", blank=True, max_length=5) Word11 = models.StringField(label="", blank=True, max_length=5) Word12 = models.StringField(label="", blank=True, max_length=5) Word_correct = models.IntegerField(initial=0) # Rebus Puzzle # Rebus1 = models.StringField(label="Solution:", blank=True) Rebus2 = models.StringField(label="Solution:", blank=True) Rebus3 = models.StringField(label="Solution:", blank=True) Rebus4 = models.StringField(label="Solution:", blank=True) Rebus5 = models.StringField(label="Solution:", blank=True) Rebus_correct = models.IntegerField(initial=0) # Trivia Questions # Trivia1 = models.IntegerField( choices=[ [1, "Horses"], [2, "Sharks"], [3, "Dogs"], [4, "Cats"], ], label='1. Pug, Alaskan Malamute, Akita, Griffon Bruxellois and Shiba Inu are all examples of what? ', widget=widgets.RadioSelect, ) Trivia2 = models.IntegerField( choices=[ [1, "Pan America"], [2, "West Jet"], [3, "Air Japan"], [4, "British Airways"], ], label='2. Which airline claims to have served the first hot in-flight meal?', widget=widgets.RadioSelect, ) Trivia3 = models.IntegerField( choices=[ [1, "The Silence of the Lambs"], [2, "Manhunter"], [3, "Hannibal Rising"], [4, "Red Dragon"], ], label='3. Jodie Foster, Anthony Hopkins and Scott Glenn all play a role in this movie that is based on a ' 'novel by Thomas Harris?', widget=widgets.RadioSelect, ) Trivia4 = models.IntegerField( choices=[ [1, "Biggs"], [2, "Christo"], [3, "Quinn"], [4, "Finer"], ], label='4. Involving a 400-meter-long orange-colored cloth, which artist created the "Valley Curtain" in 1970?', widget=widgets.RadioSelect, ) Trivia5 = models.IntegerField( choices=[ [1, "The coronation of Queen Elizabeth"], [2, "The opening of the Suez Canal"], [3, "The first FIFA World Cup"], [4, "The moon landing"], ], label='5. What television broadcast made history when it aired on the 20th of July 1969?', widget=widgets.RadioSelect, ) Trivia6 = models.IntegerField( choices=[ [1, "Rocket Man"], [2, "Space Oddity"], [3, "Mr. Spaceman"], [4, "Calling Occupants of Interplanetary Craft"], ], label='6. The following extraterrestrial lyric is from which 1969 hit song - ' '"Am I sitting in a tin can far above the world. Planet Earth is blue..."? ', widget=widgets.RadioSelect, ) Trivia7 = models.IntegerField( choices=[ [1, "Fawlty Towers"], [2, "Doctor Who"], [3, "Doctor on the Go"], [4, "100 Huntley Street"], ], label='7. According to a poll (by the British Film Institute) in 2000, ' 'what was the most popular British television show? ', widget=widgets.RadioSelect, ) Trivia8 = models.IntegerField( choices=[ [1, "Norma Talmadge"], [2, "Buster Keaton"], [3, "Gene Rodenberry"], [4, "Charlie Chaplin"], ], label='8. Which star accidently started the tradition of having footprints placed in cement?', widget=widgets.RadioSelect, ) Trivia9 = models.IntegerField( choices=[ [1, "January 28th"], [2, "March 4th"], [3, "February 16th"], [4, "February 2nd"], ], label='9. When is Groundhog Day celebrated?', widget=widgets.RadioSelect, ) Trivia10 = models.IntegerField( choices=[ [1, "Spain"], [2, "Cuba"], [3, "Mexico"], [4, "Portugal"], ], label='10. Which nation is associated with the mariachi dance?', widget=widgets.RadioSelect, ) Trivia_correct = models.IntegerField(initial=0) Sudoku_correct = models.IntegerField(initial=0) # Sudoku Task # Sudoku1 = models.StringField(label="", blank=True) Sudoku2 = models.StringField(label="", blank=True) Sudoku3 = models.StringField(label="", blank=True) Sudoku4 = models.StringField(label="", blank=True) Sudoku5 = models.StringField(label="", blank=True) Sudoku6 = models.StringField(label="", blank=True) Sudoku7 = models.StringField(label="", blank=True) Sudoku8 = models.StringField(label="", blank=True) Sudoku9 = models.StringField(label="", blank=True) # Demographic Survey Questions # Gender = models.StringField(label="What is your gender identification?") Age = models.IntegerField(label="What is your age?") Degree = models.IntegerField( choices=[ [1, "Less than high school degree"], [2, "High school graduate (high school diploma or equivalent including GED)"], [3, "Some college but no degree"], [4, "Associate degree in college (2-year)"], [5, "Bachelor’s degree in college (4-year)"], [6, "Master’s degree"], [7, "Doctoral degree (Ph.D.)"], [8, "Professional degree (e.g., JD, MD, etc.)"], ], label="What is the highest level of school you have completed or the highest degree you have received?", widget=widgets.RadioSelect, ) Major = models.StringField(label="What is/was your major(s)", blank=True) Industry = models.IntegerField( choices=[ [1, "Administrative and Support Services"], [2, "Agriculture, Forestry, Fishing, and Hunting"], [3, "Construction"], [4, "Educational Services"], [5, "Finance and Insurance"], [6, "Government"], [7, "Health Care and Social Assistance "], [8, "Information"], [9, "Management of Companies and Enterprises "], [10, "Manufacturing"], [11, "Mining, Quarrying, and Oil and Gas Extraction"], [12, "Other Services (Except Public Administration)"], [13, "Professional, Scientific, and Technical Services"], [14, "Real Estate and Rental and Leasing"], [15, "Retail"], [16, "Transportation and Warehousing"], [17, "Utilities"], [18, "Wholesale"], [19, "Others/None of the Above"], ], label="What industry do you work in?", widget=widgets.RadioSelect, ) Working_years = models.IntegerField(label="How many years of working experience do you have?") Native = models.StringField(label="What is your native language?") Languages = models.IntegerField(label="How many languages are you fluent in?") # Analytical Survey Questions # Math_classes = models.IntegerField(label="How many advanced (college-level) math classes have you taken in the " "past?") Finance_classes = models.IntegerField(label="How many advanced (college-level) finance classes have you taken in " "the past?") Economics_classes = models.IntegerField(label="How many advanced (college-level) economics classes have you taken " "in the past?") def make_field1(label): return models.IntegerField( choices=[ [1, "1 - Not Well"], [2, "2"], [3, "3"], [4, "4 - Average"], [5, "5"], [6, "6"], [7, "7 - Very Well"] ], label=label, widget=widgets.RadioSelect, ) Math_performance = make_field1('On average, well did you perform in the advanced math classes you’ve taken') Finance_performance = make_field1('On average, well did you perform in the advanced finance classes you’ve taken') Economics_performance = make_field1('On average, well did you perform in the advanced economics classes you’ve ' 'taken') def make_field2(label): return models.IntegerField( choices=[ [1, "1 - Strongly Disagree"], [2, "2"], [3, "3"], [4, "4 - Neither Agree Nor Disagree"], [5, "5"], [6, "6"], [7, "7 - Strongly Agree"] ], label=label, widget=widgets.RadioSelectHorizontal, ) Math1 = make_field2('I am good at solving math problems.') Math2 = make_field2('My work requires me to engaging in analytical thinking (for example, defining a problem, ' 'extracting key information to develop a solution, detect patterns within information to ' 'come up with solutions, etc.)') Math3 = make_field2('My work requires me to engage in math-related activities such as doing calculations.') # Creativity Survey Questions # Creativity1 = make_field2('I often find myself exploring different methods to solve a problem.') Creativity2 = make_field2('I often find myself trying to find the most efficient way to solve a problem.') Creativity3 = make_field2('I believe that I am good at finding creative solutions to a problem.') Creativity4 = make_field2('I often find myself even more motivated to solve a problem when my previous attempt to ' 'solve it failed. ') Creativity5 = make_field2('Others often come to me for advice on solving problems. ') Creativity6 = make_field2('My work requires me to brainstorm for ideas.') Creativity7 = make_field2('My work requires me to engage in strategic planning. ') Creativity8 = make_field2('My work requires me to engage in troubleshooting (e.g., trying to figure out why ' 'something has failed, why a problem occurred, etc.). ') Creativity9 = make_field2('I believe that I am good at handling stressful situations. ') Instrument = models.IntegerField( choices=[ [1, "Yes"], [2, "No"], ], label="Can you play a musical instrument?", widget=widgets.RadioSelect, ) Music_Training = models.IntegerField( choices=[ [1, "Yes"], [2, "No"], ], label="Have you ever had formal musical training for a musical instrument or singing (lessons, courses, etc.)?", widget=widgets.RadioSelect, ) Music_Years = models.IntegerField(label="If you answered yes to the question above, how many years of training" " did you complete?", blank=True) Music_Expert = make_field2('On a scale from 1 to 7, please rate to what degree you agree with the following ' 'statement: I am an expert at playing a musical instrument') # Matrix Task # matrix_answer = models.IntegerField(initial=0) matrix_correct = models.IntegerField(initial=0) #FUNCTIONS def creating_session(subsession): subsession.session.prolific_url = 'https://app.prolific.co/submissions/complete?cc=CYVBPL76' # PAGES class InformedConsent(Page): pass class GeneralInformation(Page): pass class Instructions(Page): pass class Synonym(Page): form_model = 'player' form_fields = ["Synonym1", "Synonym2", "Synonym3", "Synonym4", "Synonym5", "Synonym6", "Synonym7", "Synonym8", "Synonym9", "Synonym10"] @staticmethod def before_next_page(player: Player, timeout_happened): if player.Synonym1 == 2: player.Synonym_correct += 1 if player.Synonym2 == 4: player.Synonym_correct += 1 if player.Synonym3 == 2: player.Synonym_correct += 1 if player.Synonym4 == 2: player.Synonym_correct += 1 if player.Synonym5 == 4: player.Synonym_correct += 1 if player.Synonym6 == 1: player.Synonym_correct += 1 if player.Synonym7 == 4: player.Synonym_correct += 1 if player.Synonym8 == 2: player.Synonym_correct += 1 if player.Synonym9 == 3: player.Synonym_correct += 1 if player.Synonym10 == 4: player.Synonym_correct += 1 player.payout += player.Synonym_correct*5 class Jumble(Page): form_model = 'player' form_fields = ["Jumble1", "Jumble2", "Jumble3", "Jumble4", "Jumble5", "Jumble6", "Jumble7", "Jumble8", "Jumble9", "Jumble10"] time_on_jumble = models.FloatField() @staticmethod def before_next_page(player: Player, timeout_happened): if player.Jumble1.lower() == 'known': player.Jumble_correct += 1 if player.Jumble2.lower() == 'upper': player.Jumble_correct += 1 if player.Jumble3.lower() == 'naval': player.Jumble_correct += 1 if player.Jumble4.lower() == 'bells': player.Jumble_correct += 1 if player.Jumble5.lower() == 'flock': player.Jumble_correct += 1 if player.Jumble6.lower() == 'lucky': player.Jumble_correct += 1 if player.Jumble7.lower() == 'belly': player.Jumble_correct += 1 if player.Jumble8.lower() == 'crown': player.Jumble_correct += 1 if player.Jumble9.lower() == 'foods': player.Jumble_correct += 1 if player.Jumble10.lower() == 'chess': player.Jumble_correct += 1 player.payout += player.Jumble_correct*5 class SliderInstructions(Page): pass class Slider(Page): timeout_seconds = 180 def live_method(player, data): print(data) if data == 0: player.slider_correct += 1 else: player.slider_incorrect += 1 player.slider_attempted = player.slider_correct + player.slider_incorrect print('number_correct:', player.slider_correct) print('number_incorrect:', player.slider_incorrect) print('number_attempted:', player.slider_attempted) def js_vars(player: Player): lower1 = 101 lower2 = 11 upper1 = 500 upper2 = 99 return dict( lower1=lower1, upper1=upper1, lower2=lower2, upper2=upper2, ) @staticmethod def before_next_page(player: Player, timeout_happened): player.payout += player.slider_correct*10 class SliderFeedback(Page): def vars_for_template(p: Player): pay = p.slider_correct*10 return dict( pay=pay) class WordSearch1(Page): form_model = 'player' form_fields = ["Word1", "Word2", "Word3", "Word4"] time_on_ws1 = models.FloatField() @staticmethod def before_next_page(player: Player, timeout_happened): w1 = ['water', 'bring', 'added', 'power'] if player.Word1.lower() in w1: player.Word_correct += 1 if player.Word2.lower() in w1: player.Word_correct += 1 if player.Word3.lower() in w1: player.Word_correct += 1 if player.Word4.lower() in w1: player.Word_correct += 1 player.payout += player.Word_correct*5 class WordSearch2(Page): form_model = 'player' form_fields = ["Word5", "Word6", "Word7", "Word8"] time_on_ws2 = models.FloatField() @staticmethod def before_next_page(player: Player, timeout_happened): w2 = ['eight', 'grant', 'chief', 'occur'] if player.Word5.lower() in w2: player.Word_correct += 1 if player.Word6.lower() in w2: player.Word_correct += 1 if player.Word7.lower() in w2: player.Word_correct += 1 if player.Word8.lower() in w2: player.Word_correct += 1 player.payout += player.Word_correct*5 class WordSearch3(Page): form_model = 'player' form_fields = ["Word9", "Word10", "Word11", "Word12"] time_on_ws3 = models.FloatField() @staticmethod def before_next_page(player: Player, timeout_happened): w3 = ['horse', 'sight', 'wrong', 'tears'] if player.Word9.lower() in w3: player.Word_correct += 1 if player.Word10.lower() in w3: player.Word_correct += 1 if player.Word11.lower() in w3: player.Word_correct += 1 if player.Word12.lower() in w3: player.Word_correct += 1 player.payout += player.Word_correct*5 class LetterSearch(Page): form_model = 'player' form_fields = ["Letter1", "Letter2", "Letter3", "Letter4", "Letter5"] time_on_ls = models.FloatField() @staticmethod def before_next_page(player: Player, timeout_happened): if player.Letter1 == "7": player.Letter_correct += 1 if player.Letter2 == "2": player.Letter_correct += 1 if player.Letter3 == "4": player.Letter_correct += 1 if player.Letter4 == "5": player.Letter_correct += 1 if player.Letter5 == "3": player.Letter_correct += 1 player.payout += player.Letter_correct*10 class Rebus(Page): form_model = 'player' form_fields = ["Rebus1", "Rebus2", "Rebus3", "Rebus4", "Rebus5"] time_on_rebus = models.FloatField() @staticmethod def before_next_page(player: Player, timeout_happened): r1 = ['breakfast', 'break fast'] r2 = ['stepfather', 'step father'] r3 = ['3d movie', '3dmovie'] r4 = ['lemonade'] r5 = ['advice'] if player.Rebus1.lower() in r1: player.Rebus_correct += 1 if player.Rebus2.lower() in r2: player.Rebus_correct += 1 if player.Rebus3.lower() in r3: player.Rebus_correct += 1 if player.Rebus4.lower() in r4: player.Rebus_correct += 1 if player.Rebus5.lower() in r5: player.Rebus_correct += 1 print(player.Rebus1, player.Rebus2, player.Rebus3, player.Rebus4, player.Rebus5) player.payout += player.Rebus_correct * 10 class MathInstructions(Page): # form_model = 'player' # form_fields = ["time_on_math_instructions"] time_on_math_instructions = models.FloatField() class Addition(Page): timeout_seconds = 90 def live_method(player, data): print(data) if data == 0: player.addition_correct += 1 else: player.addition_incorrect += 1 player.addition_attempted = player.addition_correct + player.addition_incorrect print('number_correct:', player.addition_correct) print('number_incorrect:', player.addition_incorrect) print('number_attempted:', player.addition_attempted) @staticmethod def before_next_page(player: Player, timeout_happened): player.payout += player.addition_correct*5 class Subtraction(Page): timeout_seconds = 90 # form_model = 'player' # form_fields = ["time_on_subtraction"] time_on_subtraction = models.FloatField() def live_method(player, data): print(data) if data == 0: player.subtract_correct += 1 else: player.subtract_incorrect += 1 player.subtract_attempted = player.subtract_correct + player.subtract_incorrect print('number_correct:', player.subtract_correct) print('number_incorrect:', player.subtract_incorrect) print('number_attempted:', player.subtract_attempted) @staticmethod def before_next_page(player: Player, timeout_happened): player.payout += player.subtract_correct*5 class Multiply(Page): timeout_seconds = 90 # form_model = 'player' # form_fields = ["time_on_multiplication"] time_on_multiplication = models.FloatField() def live_method(player, data): print(data) if data == 0: player.multiply_correct += 1 else: player.multiply_incorrect += 1 player.multiply_attempted = player.multiply_correct + player.multiply_incorrect print('number_correct:', player.multiply_correct) print('number_incorrect:', player.multiply_incorrect) print('number_attempted:', player.multiply_attempted) @staticmethod def before_next_page(player: Player, timeout_happened): player.payout += player.multiply_correct*5 class Trivia(Page): form_model = 'player' form_fields = ["Trivia1", "Trivia2", "Trivia3", "Trivia4", "Trivia5", "Trivia6", "Trivia7", "Trivia8", "Trivia9", "Trivia10"] time_on_trivia = models.FloatField() @staticmethod def before_next_page(player: Player, timeout_happened): if player.Trivia1 == 3: player.Trivia_correct += 1 if player.Trivia2 == 1: player.Trivia_correct += 1 if player.Trivia3 == 1: player.Trivia_correct += 1 if player.Trivia4 == 2: player.Trivia_correct += 1 if player.Trivia5 == 4: player.Trivia_correct += 1 if player.Trivia6 == 2: player.Trivia_correct += 1 if player.Trivia7 == 1: player.Trivia_correct += 1 if player.Trivia8 == 1: player.Trivia_correct += 1 if player.Trivia9 == 4: player.Trivia_correct += 1 if player.Trivia10 == 3: player.Trivia_correct += 1 player.payout += player.Trivia_correct * 5 class Sudoku(Page): form_model = 'player' form_fields = ["Sudoku1", "Sudoku2", "Sudoku3", "Sudoku4", "Sudoku5", "Sudoku6", "Sudoku7", "Sudoku8", "Sudoku9",] time_on_sudoku = models.FloatField() @staticmethod def before_next_page(player: Player, timeout_happened): if player.Sudoku1 == "9": player.Sudoku_correct += 1 if player.Sudoku2 == "3": player.Sudoku_correct += 1 if player.Sudoku3 == "5": player.Sudoku_correct += 1 if player.Sudoku4 == "2": player.Sudoku_correct += 1 if player.Sudoku5 == "7": player.Sudoku_correct += 1 if player.Sudoku6 == "4": player.Sudoku_correct += 1 if player.Sudoku7 == "6": player.Sudoku_correct += 1 if player.Sudoku8 == "4": player.Sudoku_correct += 1 if player.Sudoku9 == "5": player.Sudoku_correct += 1 player.payout += player.Sudoku_correct * 5 class Matrix(Page): form_model = 'player' form_fields = ['matrix_answer'] timeout_seconds = 120 timer_text = ' ' time_on_matrix = models.FloatField() def live_method(player, data): print(data) player.matrix_correct = data print(player.matrix_correct) @staticmethod def before_next_page(player: Player, timeout_happened): player.payout += player.matrix_correct*5 class DemographicsSurvey(Page): form_model = 'player' form_fields = ["Gender", "Age", "Degree", "Major", "Industry", "Working_years", "Native", "Languages"] @staticmethod def before_next_page(player: Player, timeout_happened): player.payoff = (player.payout/50) player.total_pay = 3 + (player.payout/50) player.participant.finished = True class MathSurvey(Page): form_model = 'player' form_fields = ["Math_classes", "Finance_classes", "Economics_classes", "Math_performance", "Finance_performance", "Economics_performance", "Math1", "Math2", "Math3"] time_on_math_survey = models.FloatField() class CreativitySurvey(Page): form_model = 'player' form_fields = ["Creativity1", "Creativity2", "Creativity3", "Creativity4", "Creativity5", "Creativity6", "Creativity7", "Creativity8", "Creativity9", "Instrument", "Music_Training", "Music_Years", "Music_Expert"] time_on_creativity_survey = models.FloatField() class Results(Page): def vars_for_template(p: Player): correct1 = p.Synonym_correct correct2 = p.Letter_correct correct3 = p.Word_correct correct4 = p.Rebus_correct correct5 = p.Trivia_correct correct6 = p.addition_correct correct7 = p.subtract_correct correct8 = p.multiply_correct correct9 = p.matrix_correct # print(p.Synonym_correct, p.Letter_correct) return dict( correct1=correct1, correct2=correct2, correct3=correct3, correct4=correct4, correct5=correct5, correct6=correct6, correct7=correct7, correct8=correct8, correct9=correct9, ) form_model = 'player' class JumbleInstructions(Page): pass class JumbleFeedback(Page): def vars_for_template(p: Player): pay = p.Jumble_correct*5 return dict( pay=pay) class SynonymInstructions(Page): pass class SynonymFeedback(Page): def vars_for_template(p: Player): pay = p.Synonym_correct * 5 return dict( pay=pay) class LSInstructions(Page): pass class LSFeedback(Page): def vars_for_template(p: Player): pay = p.Letter_correct * 10 return dict( pay=pay) class WSInstructions(Page): pass class WSFeedback(Page): def vars_for_template(p: Player): pay = p.Word_correct * 5 return dict( pay=pay) class SudokuInstructions(Page): pass class SudokuFeedback(Page): def vars_for_template(p: Player): pay = p.Sudoku_correct * 5 return dict( pay=pay) class MatrixInstructions(Page): pass class MatrixFeedback(Page): def vars_for_template(p: Player): pay = p.matrix_correct * 5 return dict( pay=pay) class AdditionFeedback(Page): def vars_for_template(p: Player): pay = p.addition_correct*5 return dict( pay=pay) class SubtractionFeedback(Page): def vars_for_template(p: Player): pay = p.subtract_correct * 5 return dict( pay=pay) class MultiplicationFeedback(Page): def vars_for_template(p: Player): pay = p.multiply_correct * 5 return dict( pay=pay) class RebusInstructions(Page): pass class RebusFeedback(Page): def vars_for_template(p: Player): pay = p.Rebus_correct * 10 return dict( pay=pay) class TriviaInstructions(Page): pass class TriviaFeedback(Page): def vars_for_template(p: Player): pay = p.Trivia_correct * 5 return dict( pay=pay) page_sequence = [InformedConsent, GeneralInformation, Instructions, JumbleInstructions, Jumble, JumbleFeedback, SynonymInstructions, Synonym, SynonymFeedback, LSInstructions, LetterSearch, LSFeedback, WSInstructions, WordSearch1, WordSearch2, WordSearch3, WSFeedback, SudokuInstructions, Sudoku, SudokuFeedback, MatrixInstructions, Matrix, MatrixFeedback, MathInstructions, Addition, AdditionFeedback, Subtraction, SubtractionFeedback, Multiply, MultiplicationFeedback, SliderInstructions, Slider, SliderFeedback, RebusInstructions, Rebus, RebusFeedback, TriviaInstructions, Trivia, TriviaFeedback, MathSurvey, CreativitySurvey, DemographicsSurvey, Results]