from otree.api import * c = cu doc = '' class Constants(BaseConstants): name_in_url = 'BFAS_survey' players_per_group = None num_rounds = 1 tutorial_num_players = 6 tutorial_num_turns = 5 tutorial_multiplication_factor = 2 tutorial_endowment = cu(120) tutorial_interest = '10%' tutorial_time_limit = '3 minutes' tutorial_p2_forecast_template = 'BFAS_survey/tutorial_p2_forecast.html' class Subsession(BaseSubsession): pass def calculate_BFAS(group): players = group.get_players() print(players) #for p in players: # p.Openness_10 = ( p.Q10 + p.Q20 + p.Q30 + p.Q40 + (6 - p.Q50) + (6 - p.Q60) + p.Q70 + (6 - p.Q80) + (6 - p.Q90) + p.Q100 ) * 2 # p.Intellect_10 = ( p.Q5 + (6 - p.Q15) + p.Q25 + p.Q35 + (6 - p.Q45) + (6 - p.Q55) + p.Q65 + p.Q75 + (6 - p.Q85) + p.Q95 ) * 2 # p.Industriousness_10 = ( p.Q3 + (6 - p.Q13) + (6 - p.Q23) + (6 - p.Q33) + p.Q43 + (6 - p.Q53) + p.Q63 + p.Q73 + (6 - p.Q83) + (6 - p.Q93) ) * 2 # p.Orderliness_10 = ( (6 - p.Q8) + p.Q18 + p.Q28 + p.Q38 + (6 - p.Q48) + p.Q58 + (6 - p.Q68) + (6 - p.Q78) + p.Q88 + p.Q98 ) * 2 # p.Enthusiasm_10 = ( p.Q4 + (6 - p.Q14) + (6 - p.Q24) + (6 - p.Q34) + p.Q44 + (6 - p.Q54) + (6 - p.Q64) + p.Q74 + p.Q84 + p.Q94 ) * 2 #p.Assertiveness_10 = ( p.Q9 + p.Q19 + (6 - p.Q29) + p.Q39 + (6 - p.Q49) + p.Q59 + p.Q69 + (6 - p.Q79) + p.Q89 + (6 - p.Q99) ) * 2 #p.Compassion_10 = ( (6 - p.Q2) + p.Q12 + p.Q22 + (6 - p.Q32) + p.Q42 + (6 - p.Q52) + (6 - p.Q62) + p.Q72 + (6 - p.Q82) + p.Q92 ) * 2 #p.Politeness_10 = ( p.Q7 + (6 - p.Q17) + p.Q27 + (6 - p.Q37) + p.Q47 + p.Q57 + (6 - p.Q67) + (6 - p.Q77) + (6 - p.Q87) + (6 - p.Q97) ) * 2 #p.Withdrawal_10 = ( (6 - p.Q1) + p.Q11 + (6 - p.Q21) + p.Q31 + (6 - p.Q41) + p.Q51 + p.Q61 + (6 - p.Q71) + p.Q81 + p.Q91 ) * 2 #p.Volatility_10 = ( p.Q6 + (6 - p.Q16) + p.Q26 + (6 - p.Q36) + p.Q46 + (6 - p.Q56) + p.Q66 + (6 - p.Q76) + p.Q86 + p.Q96 ) * 2 #p.Openness_05 = ( p.Openness_10 + p.Intellect_10 ) // 2 #p.Conscientiousness_05 = ( p.Industriousness_10 + p.Orderliness_10 ) // 2 #p.Extraversion_05 = ( p.Enthusiasm_10 + p.Assertiveness_10 ) // 2 #p.Agreeableness_05 = ( p.Compassion_10 + p.Politeness_10) // 2 #p.Neuroticism_05 = ( p.Withdrawal_10 + p.Volatility_10) // 2 # print('for loop:', p.Openness_10) class Group(BaseGroup): calculate_BFAS = calculate_BFAS def tutorial_q2_error_message(player, value): if value != (3 * Constants.tutorial_multiplication_factor): return('This answer is not correct. HINT: What is the number of points you contribute times the multiplication factor?') def tutorial_q3_error_message(player, value): if value != (20): return('This answer is not correct. HINT: Scroll over the bar corresponding to Player 3.') def tutorial_q4_error_message(player, value): if value != (20 * 0.10): return("This answer is not correct. HINT: What is (severity) x (Player 2's percent chance of being hit)?") def tutorial_q5_error_message(player, value): if value != (10): return('This answer is not correct. HINT: What is (the sum of all player contributions) x (multiplication factor) + (starting shield)?') def tutorial_q6_error_message(player, value): if value != 6: return('This answer is not correct. HINT: What is the sum of all player damages minus the value of the community shield?') def tutorial_q7_error_message(player, value): if value != 0: return('This answer is not correct. HINT: The shield cannot go below 0.') def tutorial_q8_error_message(player, value): if value != 7: return('This answer is not correct. HINT: What was your individual contribution plus your net damage from the disaster?') class Player(BasePlayer): Openness_05 = models.IntegerField() Conscientiousness_05 = models.IntegerField() Extraversion_05 = models.IntegerField() Agreeableness_05 = models.IntegerField() Neuroticism_05 = models.IntegerField() Openness_10 = models.IntegerField() Intellect_10 = models.IntegerField() Industriousness_10 = models.IntegerField() Orderliness_10 = models.IntegerField() Enthusiasm_10 = models.IntegerField() Assertiveness_10 = models.IntegerField() Compassion_10 = models.IntegerField() Politeness_10 = models.IntegerField() Volatility_10 = models.IntegerField() Withdrawal_10 = models.IntegerField() Q1 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='1. ___ Seldom feel blue.', widget=widgets.RadioSelectHorizontal) Q2 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label="2. ___ Am not interested in other people's problems.", widget=widgets.RadioSelectHorizontal) Q3 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='3. ___ Carry out my plans.', widget=widgets.RadioSelectHorizontal) Q4 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='4. ___ Make friends easily.', widget=widgets.RadioSelectHorizontal) Q5 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='5. ___ Am quick to understand things.', widget=widgets.RadioSelectHorizontal) Q6 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='6. ___ Get angry easily.', widget=widgets.RadioSelectHorizontal) Q7 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='7. ___ Respect authority.', widget=widgets.RadioSelectHorizontal) Q8 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='8. ___ Leave my belongings around.', widget=widgets.RadioSelectHorizontal) Q9 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='9. ___ Take charge.', widget=widgets.RadioSelectHorizontal) Q10 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='10. ___ Enjoy the beauty of nature.', widget=widgets.RadioSelectHorizontal) Q11 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='11. ___ Am filled with doubts about things.', widget=widgets.RadioSelectHorizontal) Q12 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label="12. ___ Feel others' emotions.", widget=widgets.RadioSelectHorizontal) Q13 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='13. ___ Waste my time.', widget=widgets.RadioSelectHorizontal) Q14 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='14. ___ Am hard to get to know.', widget=widgets.RadioSelectHorizontal) Q15 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='15. ___ Have difficulty understanding abstract ideas.', widget=widgets.RadioSelectHorizontal) Q16 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='16. __ Rarely get irritated.', widget=widgets.RadioSelectHorizontal) Q17 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='17. ___ Believe that I am better than others.', widget=widgets.RadioSelectHorizontal) Q18 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='18. ___ Like order.', widget=widgets.RadioSelectHorizontal) Q19 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='19. ___ Have a strong personality.', widget=widgets.RadioSelectHorizontal) Q20 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='20. ___ Believe in the importance of art.', widget=widgets.RadioSelectHorizontal) Q21 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='21. ___ Feel comfortable with myself.', widget=widgets.RadioSelectHorizontal) Q22 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label="22. ___ Inquire about others' well-being.", widget=widgets.RadioSelectHorizontal) Q23 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='23. ___ Find it difficult to get down to work.', widget=widgets.RadioSelectHorizontal) Q24 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='24. ___ Keep others at a distance.', widget=widgets.RadioSelectHorizontal) Q25 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='25. ___ Can handle a lot of information.', widget=widgets.RadioSelectHorizontal) Q26 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='26. ___ Get upset easily.', widget=widgets.RadioSelectHorizontal) Q27 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='27. ___ Hate to seem pushy.', widget=widgets.RadioSelectHorizontal) Q28 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='28. ___ Keep things tidy.', widget=widgets.RadioSelectHorizontal) Q29 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='29. ___ Lack the talent for influencing people.', widget=widgets.RadioSelectHorizontal) Q30 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='30. ___ Love to reflect on things.', widget=widgets.RadioSelectHorizontal) Q31 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='31. ___ Feel threatened easily.', widget=widgets.RadioSelectHorizontal) Q32 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label="32. ___ Can't be bothered with other's needs.", widget=widgets.RadioSelectHorizontal) Q33 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='33. ___ Mess things up.', widget=widgets.RadioSelectHorizontal) Q34 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='34. ___ Reveal little about myself.', widget=widgets.RadioSelectHorizontal) Q35 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='35. ___ Like to solve complex problems.', widget=widgets.RadioSelectHorizontal) Q36 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='36. ___ Keep my emotions under control.', widget=widgets.RadioSelectHorizontal) Q37 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='37. ___ Take advantage of others.', widget=widgets.RadioSelectHorizontal) Q38 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='38. ___ Follow a schedule.', widget=widgets.RadioSelectHorizontal) Q39 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='39. ___ Know how to captivate people.', widget=widgets.RadioSelectHorizontal) Q40 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='40. ___ Get deeply immersed in music.', widget=widgets.RadioSelectHorizontal) Q41 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='41. ___ Rarely feel depressed.', widget=widgets.RadioSelectHorizontal) Q42 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label="42. ___ Sympathize with others' feelings.", widget=widgets.RadioSelectHorizontal) Q43 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='43. ___ Finish what I start.', widget=widgets.RadioSelectHorizontal) Q44 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='44. ___ Warm up quickly to others.', widget=widgets.RadioSelectHorizontal) Q45 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='45. ___ Avoid philosophical discussions.', widget=widgets.RadioSelectHorizontal) Q46 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='46. ___ Change my mood a lot.', widget=widgets.RadioSelectHorizontal) Q47 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='47. ___ Avoid imposing my will on others.', widget=widgets.RadioSelectHorizontal) Q48 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='48. ___ Am not bothered by messy people.', widget=widgets.RadioSelectHorizontal) Q49 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='49. ___ Wait for others to lead the way.', widget=widgets.RadioSelectHorizontal) Q50 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='50. ___ Do not like poetry.', widget=widgets.RadioSelectHorizontal) Q51 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='51. ___ Worry about things.', widget=widgets.RadioSelectHorizontal) Q52 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='52. ___ Am indifferent to the feelings of others.', widget=widgets.RadioSelectHorizontal) Q53 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label="53. ___ Don't put my mind on the task at hand.", widget=widgets.RadioSelectHorizontal) Q54 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='54. ___ Rarely get caught up in the excitement.', widget=widgets.RadioSelectHorizontal) Q55 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='55. ___ Avoid difficult reading material.', widget=widgets.RadioSelectHorizontal) Q56 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='56. ___ Rarely lose my composure.', widget=widgets.RadioSelectHorizontal) Q57 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='57. ___ Rarely put people under pressure.', widget=widgets.RadioSelectHorizontal) Q58 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='58. ___ Want everything to be “just right.”', widget=widgets.RadioSelectHorizontal) Q59 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='59. ___ See myself as a good leader.', widget=widgets.RadioSelectHorizontal) Q60 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='60. ___ Seldom notice the emotional aspects of paintings and pictures.', widget=widgets.RadioSelectHorizontal) Q61 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='61. ___ Am easily discouraged.', widget=widgets.RadioSelectHorizontal) Q62 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='62. ___ Take no time for others.', widget=widgets.RadioSelectHorizontal) Q63 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='63. ___ Get things done quickly.', widget=widgets.RadioSelectHorizontal) Q64 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='64. ___ Am not a very enthusiastic person.', widget=widgets.RadioSelectHorizontal) Q65 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='65. ___ Have a rich vocabulary.', widget=widgets.RadioSelectHorizontal) Q66 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='66. ___ Am a person whose moods go up and down easily.', widget=widgets.RadioSelectHorizontal) Q67 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='67. ___ Insult people.', widget=widgets.RadioSelectHorizontal) Q68 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='68. ___ Am not bothered by disorder.', widget=widgets.RadioSelectHorizontal) Q69 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='69. ___ Can talk others into doing things.', widget=widgets.RadioSelectHorizontal) Q70 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='70. ___ Need a creative outlet.', widget=widgets.RadioSelectHorizontal) Q71 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='71. ___ Am not embarrassed easily.', widget=widgets.RadioSelectHorizontal) Q72 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label="72. ___ Take an interest in other people's lives.", widget=widgets.RadioSelectHorizontal) Q73 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='73. ___ Always know what I am doing.', widget=widgets.RadioSelectHorizontal) Q74 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label="74. ___ Show my feelings when I'm happy.", widget=widgets.RadioSelectHorizontal) Q75 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='75. ___ Think quickly.', widget=widgets.RadioSelectHorizontal) Q76 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='76. ___ Am not easily annoyed.', widget=widgets.RadioSelectHorizontal) Q77 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='77. ___ Seek conflict.', widget=widgets.RadioSelectHorizontal) Q78 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='78. ___ Dislike routine.', widget=widgets.RadioSelectHorizontal) Q79 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='79. ___ Hold back my opinions.', widget=widgets.RadioSelectHorizontal) Q80 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='80. ___ Seldom get lost in thought.', widget=widgets.RadioSelectHorizontal) Q81 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='81. ___ Become overwhelmed by events.', widget=widgets.RadioSelectHorizontal) Q82 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label="82. ___ Don't have a soft side.", widget=widgets.RadioSelectHorizontal) Q83 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='83. ___ Postpone decisions.', widget=widgets.RadioSelectHorizontal) Q84 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='84. ___ Have a lot of fun.', widget=widgets.RadioSelectHorizontal) Q85 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='85. ___ Learn things slowly.', widget=widgets.RadioSelectHorizontal) Q86 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='86. ___ Get easily agitated.', widget=widgets.RadioSelectHorizontal) Q87 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='87. ___ Love a good fight.', widget=widgets.RadioSelectHorizontal) Q88 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='88. ___ See that rules are observed.', widget=widgets.RadioSelectHorizontal) Q89 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='89. ___ Am the first to act.', widget=widgets.RadioSelectHorizontal) Q90 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='90. ___ Seldom daydream.', widget=widgets.RadioSelectHorizontal) Q91 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='91. ___ Am afraid of many things.', widget=widgets.RadioSelectHorizontal) Q92 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='92. ___ Like to do things for others.', widget=widgets.RadioSelectHorizontal) Q93 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='93. ___ Am easily distracted.', widget=widgets.RadioSelectHorizontal) Q94 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='94. ___ Laugh a lot.', widget=widgets.RadioSelectHorizontal) Q95 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='95. ___ Formulate ideas clearly.', widget=widgets.RadioSelectHorizontal) Q96 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='96. ___ Can be stirred up easily.', widget=widgets.RadioSelectHorizontal) Q97 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='97. ___ Am out for my own personal gain.', widget=widgets.RadioSelectHorizontal) Q98 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='98. ___ Want every detail taken care of.', widget=widgets.RadioSelectHorizontal) Q99 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='99. ___ Do not have an assertive personality.', widget=widgets.RadioSelectHorizontal) Q100 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='100. ___ See beauty in things that others might not notice.', widget=widgets.RadioSelectHorizontal) tutorial_q2 = models.CurrencyField(label='If you contribute 3 points, how many points will be added to the community shield?') tutorial_q3 = models.IntegerField(label="What is Player 3's percent chance of receiving damage from this disaster? (answer in whole numbers)") tutorial_q4 = models.CurrencyField(label='How much damage can Player 2 expect to receive this turn?') tutorial_q5 = models.CurrencyField(label='What is the new value of the community shield?') tutorial_q6 = models.CurrencyField(label='After taking into account the community shield, what is the net damage to the community?') tutorial_q7 = models.CurrencyField(label='In this example, the shield was less than the community damage. How many shield points will be carried over to the next turn?') tutorial_q8 = models.CurrencyField(label='What was your individual loss for this turn?') tutorial_q2_error_message = tutorial_q2_error_message tutorial_q3_error_message = tutorial_q3_error_message tutorial_q4_error_message = tutorial_q4_error_message tutorial_q5_error_message = tutorial_q5_error_message tutorial_q6_error_message = tutorial_q6_error_message tutorial_q7_error_message = tutorial_q7_error_message tutorial_q8_error_message = tutorial_q8_error_message class Questionnaire(Page): form_model = 'player' form_fields = ['Q1', 'Q2', 'Q3', 'Q4', 'Q5', 'Q6', 'Q7', 'Q8', 'Q9', 'Q10', 'Q11', 'Q12', 'Q13', 'Q14', 'Q15', 'Q16', 'Q17', 'Q18', 'Q19', 'Q20', 'Q21', 'Q22', 'Q23', 'Q24', 'Q25', 'Q26', 'Q27', 'Q28', 'Q29', 'Q30', 'Q31', 'Q32', 'Q33', 'Q34', 'Q35', 'Q36', 'Q37', 'Q38', 'Q39', 'Q40', 'Q41', 'Q42', 'Q43', 'Q44', 'Q45', 'Q46', 'Q47', 'Q48', 'Q49', 'Q50', 'Q51', 'Q52', 'Q53', 'Q54', 'Q55', 'Q56', 'Q57', 'Q58', 'Q59', 'Q60', 'Q61', 'Q62', 'Q63', 'Q64', 'Q65', 'Q66', 'Q67', 'Q68', 'Q69', 'Q70', 'Q71', 'Q72', 'Q73', 'Q74', 'Q75', 'Q76', 'Q77', 'Q78', 'Q79', 'Q80', 'Q81', 'Q82', 'Q83', 'Q84', 'Q85', 'Q86', 'Q87', 'Q88', 'Q89', 'Q90', 'Q91', 'Q92', 'Q93', 'Q94', 'Q95', 'Q96', 'Q97', 'Q98', 'Q99', 'Q100'] @staticmethod def before_next_page(player, timeout_happened): player.Openness_10 = ( player.Q10 + player.Q20 + player.Q30 + player.Q40 + (6 - player.Q50) + (6 - player.Q60) + player.Q70 + (6 - player.Q80) + (6 - player.Q90) + player.Q100 ) * 2 player.Intellect_10 = ( player.Q5 + (6 - player.Q15) + player.Q25 + player.Q35 + (6 - player.Q45) + (6 - player.Q55) + player.Q65 + player.Q75 + (6 - player.Q85) + player.Q95 ) * 2 player.Industriousness_10 = ( player.Q3 + (6 - player.Q13) + (6 - player.Q23) + (6 - player.Q33) + player.Q43 + (6 - player.Q53) + player.Q63 + player.Q73 + (6 - player.Q83) + (6 - player.Q93) ) * 2 player.Orderliness_10 = ( (6 - player.Q8) + player.Q18 + player.Q28 + player.Q38 + (6 - player.Q48) + player.Q58 + (6 - player.Q68) + (6 - player.Q78) + player.Q88 + player.Q98 ) * 2 player.Enthusiasm_10 = ( player.Q4 + (6 - player.Q14) + (6 - player.Q24) + (6 - player.Q34) + player.Q44 + (6 - player.Q54) + (6 - player.Q64) + player.Q74 + player.Q84 + player.Q94 ) * 2 player.Assertiveness_10 = ( player.Q9 + player.Q19 + (6 - player.Q29) + player.Q39 + (6 - player.Q49) + player.Q59 + player.Q69 + (6 - player.Q79) + player.Q89 + (6 - player.Q99) ) * 2 player.Compassion_10 = ( (6 - player.Q2) + player.Q12 + player.Q22 + (6 - player.Q32) + player.Q42 + (6 - player.Q52) + (6 - player.Q62) + player.Q72 + (6 - player.Q82) + player.Q92 ) * 2 player.Politeness_10 = ( player.Q7 + (6 - player.Q17) + player.Q27 + (6 - player.Q37) + player.Q47 + player.Q57 + (6 - player.Q67) + (6 - player.Q77) + (6 - player.Q87) + (6 - player.Q97) ) * 2 player.Withdrawal_10 = ( (6 - player.Q1) + player.Q11 + (6 - player.Q21) + player.Q31 + (6 - player.Q41) + player.Q51 + player.Q61 + (6 - player.Q71) + player.Q81 + player.Q91 ) * 2 player.Volatility_10 = ( player.Q6 + (6 - player.Q16) + player.Q26 + (6 - player.Q36) + player.Q46 + (6 - player.Q56) + player.Q66 + (6 - player.Q76) + player.Q86 + player.Q96 ) * 2 player.Openness_05 = ( player.Openness_10 + player.Intellect_10 ) // 2 player.Conscientiousness_05 = ( player.Industriousness_10 + player.Orderliness_10 ) // 2 player.Extraversion_05 = ( player.Enthusiasm_10 + player.Assertiveness_10 ) // 2 player.Agreeableness_05 = ( player.Compassion_10 + player.Politeness_10) // 2 player.Neuroticism_05 = ( player.Withdrawal_10 + player.Volatility_10) // 2 class TutorialP1_intro(Page): form_model = 'player' class TutorialP2_contribute(Page): form_model = 'player' form_fields = ['tutorial_q2'] class TutorialP3_hit(Page): form_model = 'player' form_fields = ['tutorial_q3'] @staticmethod def js_vars(player): return dict( severity = 20, endowment_half = Constants.tutorial_endowment / 2, hit_probs_others = [0, 10, 20], hit_probs_you = [50, 0, 0], categories = ['You'] + ['Player 2', 'Player 3'] ) class TutorialP4_damage(Page): form_model = 'player' form_fields = ['tutorial_q4'] @staticmethod def js_vars(player): return dict( severity = 20, endowment_half = Constants.tutorial_endowment / 2, hit_probs_others = [0, 10, 20], hit_probs_you = [50, 0, 0], categories = ['You'] + ['Player 2', 'Player 3'] ) class TutorialP5_shield(Page): form_model = 'player' form_fields = ['tutorial_q5'] class TutorialP6_recover(Page): form_model = 'player' form_fields = ['tutorial_q6'] class TutorialP7_remaining(Page): form_model = 'player' form_fields = ['tutorial_q7'] class TutorialP8_loss(Page): form_model = 'player' form_fields = ['tutorial_q8'] class TutorialP9_interest(Page): form_model = 'player' class TutorialP10_end(Page): form_model = 'player' page_sequence = [Questionnaire, TutorialP1_intro, TutorialP2_contribute, TutorialP3_hit, TutorialP4_damage, TutorialP5_shield, TutorialP6_recover, TutorialP7_remaining, TutorialP8_loss, TutorialP9_interest, TutorialP10_end]