from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) import random author = 'Your name here' doc = """ Your app description """ class Constants(BaseConstants): name_in_url = 'complain_inter' players_per_group = 2 num_rounds = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass def make_field(label): return models.IntegerField( choices=[ [1, ''], [2, ''], [3, ''], [4, ''], [5, ''], ], label=label, widget=widgets.RadioSelect, ) def make_field2(label): return models.IntegerField( choices=[ [1, ''], [2, ''], [3, ''], [4, ''], [5, ''], [6, ''], [7, ''], ], label=label, widget=widgets.RadioSelect, ) def make_field3(label): return models.IntegerField( choices=[ [1, ''], [2, ''], [3, ''], [4, ''], [5, ''], [6, ''], ], label=label, widget=widgets.RadioSelect, ) class Player(BasePlayer): #Grit q1 = make_field("New ideas and projects sometimes distract me from previous ones") q2 = make_field("Setbacks don't discourage me. I don't give up easily") q3 = make_field("I often set a goal but later choose to pursue a different one") q4 = make_field("I am a hard worker") q5 = make_field("I have difficulty maintaining my focus on projects that take more than a few months to complete") q6 = make_field("I finish whatever I begin") q7 = make_field("My interests change from year to year") q8 = make_field("I am diligent. I never give up") q9 = make_field("I have been obsessed with a certain idea or project for a short time but later lost interest") #PassionAttainment a1 = make_field2("I am less passionate for my studies than I should be") a2 = make_field2("I often feel as if I have to be more passionate for my studies") a3 = make_field2("I frequently feel obliged to be more passionate for my studies than I currently am") #Neuroticism b1 = make_field("Is relaxed, handles stress well") b2 = make_field("Worries a lot") b3 = make_field("Rarely feels anxious or afraid") b4 = make_field("Can be tense") b5 = make_field("Often feels sad") b6 = make_field("Tends to feel depressed, blue") b7 = make_field("Feels secure, comfortable with self") b8 = make_field("Stays optimistic after experiencing a setback") b9 = make_field("Is emotionally stable, not easily upset") b10 = make_field("Is temperamental, gets emotional easily") b11 = make_field("Keeps their emotions under control") b12 = make_field("Is moody, has up and down mood swings") #Ten Item Personality Inventory (TIPI) c1 = make_field2("Extroverted, enthusiastic") c2 = make_field2("Critical, quarrelsome") c3 = make_field2("Dependable, self-disciplined") c4 = make_field2("Anxious, easily upset") c5 = make_field2("Open to new experiences, complex") c6 = make_field2("Reserved, quiet") c7 = make_field2("Sympathetic, warm") c8 = make_field2("Disorganized, careless") c9 = make_field2("Calm, emotionally stable") c10 = make_field2("Conventional, uncreative") #Goal Achievement Framework d1 = make_field("My aim is to completely master the material presented in my classes") d2 = make_field("I am striving to understand the content of my courses as thoroughly as possible") d3 = make_field("My goal is to learn as much as possible") d4 = make_field("My aim is to avoid learning less than I possibly could") d5 = make_field("I am striving to avoid an incomplete understanding of the course material") d6 = make_field("My goal is to avoid learning less than it is possible to learn") d7 = make_field("My aim is to perform well relative to other students") d8 = make_field("I am striving to do well compared to other students") d9 = make_field("My goal is to perform better than the other students") d10 = make_field("My aim is to avoid doing worse than other students") d11 = make_field("I am striving to avoid performing worse than others") d12 = make_field("My goal is to avoid performing poorly compared to others") #Motive to Communicate Goal Pursuit e1 = make_field2("I talk about my successes because I want people to think highly of me") e2 = make_field2("When I let others know of my achievements, I am doing it to gain their praise") e3 = make_field2("I want to tell others about my successes because it raises my social status") e4 = make_field2("I talk about my accomplishments to attract people's attention") e5 = make_field2("I talk about my accomplishments because it makes me feel superior") e6 = make_field2("I tell people about my successes to make them feel envious of me") e7 = make_field2("I share about my successes because it makes me feel good about myself") e8 = make_field2("I only talk about my aspirations or goals when it makes me look good") e9 = make_field2("I share my failures with others because it draws people's attention") e10 = make_field2("I tell people about my success because it makes them feel proud of me") e11 = make_field2("I hope others can be motivated when I share about the failures that I have overcome") e12 = make_field2("By talking about my achievements, I want others to be inspired") e13 = make_field2("I tell others about my failures so that they will not repeat the mistakes I made") e14 = make_field2("When I talk about my experiences, I'm not concerned with making it a learning experience for others") e15 = make_field2("I talk about the challenges I face so that people are aware of the challenges in engaging in a particular task") e16 = make_field2("I am eager to share my secrets of success with others") e17 = make_field2("Sharing about my goals makes me feel more driven to see them through") e18 = make_field2("Telling someone about what I am working towards is the best way to get me motivated to achieve them.") e19 = make_field2("I tell others about my tasks to feel more committed to them") e20 = make_field2("I tell others about my aspirations to rekindle my passion") e21 = make_field2("I repeatedly talk about my goals to help me stay focused on them") e22 = make_field2("I talk to others about my frustrations because I just want to 'let off steam'") e23 = make_field2("I vent to help me put my frustrations behind me") e24 = make_field2("When I face an unexpected obstacle, I feel a need to vent to others about it") e25 = make_field2("I talk to others usually just to vent my frustrations") e26 = make_field2("I seldom vent as venting only makes me feel worse") e27 = make_field2("I don't like to bottle up the frustrations I face when pursuing my goals") e28 = make_field2("When I tell others about my failures, I want to be comforted") e29 = make_field2("When I tell people about my struggles at work, I want them to encourage me") e30 = make_field2("I want my friends to express concern when I complain to them about my frustrations") e31 = make_field2("I am more likely to discuss my goals with someone who will cheer me on") e32 = make_field2("If I know someone is not going to sympathise with me, I don't bother complaining to him/her") e33 = make_field2("I share my failures with others to make them feel that they are important to me") e34 = make_field2("I talk to others about my failures because it makes me feel closer to them") e35 = make_field2("I share my successes with others to make them feel that they are important to me") e36 = make_field2("I tell my friends about my goals and aspirations to bring us closer together") e37 = make_field2("I maintain my connections with people by sharing my frustrations with them") e38 = make_field2("I hope people can offer their assistance when I tell them about my challenges") e39 = make_field2("When I share my frustrations with others, I am looking for guidance") e40 = make_field2("When I complain about my problems, I often hope that someone offers me a solution") e41 = make_field2("When I complain to others about the challenges I face, I am not expecting help") e42 = make_field2("The main reason why I tell others my goals is usually to get help in achieving them") e43 = make_field2("When I talk to others about my goals, I am interested to know if they share the same sentiments as me") e44 = make_field2("I tell others about my problems to find out if they share the same problems") e45 = make_field2("I talk to others to find out if they share similar views as me on how best to tackle a problem") e46 = make_field2("I complain to see if others have the same complaints") #Implicit Theories of Intelligence g1 = make_field3("You have a certain amount of intelligence, and you can't really do much to change it") g2 = make_field3("Your intelligence is something about you that you can't change very much") g3 = make_field3("You can learn new things, but you can't really change your basic intelligence") g4 = make_field3("To be honest, you can't really change how intelligent you are") #Sense of Belonging h1 = make_field2("I feel I belong within my department") h2 = make_field2("I am confident I made the right decision in choosing my course major") h3 = make_field2("I am satisfied with my academic experience") h4 = make_field2("I feel comfortable in NUS") h5 = make_field2("People in NUS accept me") h6 = make_field2("I feel a strong sense of belonging to NUS") #Belonging Uncertainty i1 = make_field2("Sometimes I feel that I belong at NUS, and sometimes I feel that I don't belong") i2 = make_field2("When something bad happens, I feel that maybe I don't belong at NUS") i3 = make_field2("When something good happens, I feel that I really belong at NUS") #PANAS j1 = make_field("Interested") j2 = make_field("Distressed") j3 = make_field("Excited") j4 = make_field("Upset") j5 = make_field("Strong") j6 = make_field("Guilty") j7 = make_field("Scared") j8 = make_field("Hostile") j9 = make_field("Enthusiastic") j10 = make_field("Proud") j11 = make_field("Irritable") j12 = make_field("Alert") j13 = make_field("Ashamed") j14 = make_field("Inspired") j15 = make_field("Nervous") j16 = make_field("Determined") j17 = make_field("Attentive") j18 = make_field("Jittery") j19 = make_field("Active") j20 = make_field("Afraid") #Difficult/Effortful k1 = make_field2("It was difficult thinking about the academic challenges I face in university") k2 = make_field2("It was effortful to think about the academic difficulties I face in university") k3 = make_field2("Thinking about the academic challenges I face in university felt tedious") #ImpOpp m1 = make_field3("You may be a person with many good opportunities, you may be a person with few. You can't do much to change that") m2 = make_field3("You may or may not be a person who has many good opportunities and there isn't much you can do to change that") m3 = make_field3("You might be a person who has many good opportunities or you might not be. You can't do much to change that") #Clear n1 = make_field2("I have a clear understanding of how to improve my grades") n2 = make_field2("I am certain that I can perform better for my courses") #SelfEff o1 = make_field("I will be able to achieve most of the goals that I have set for myself") o2 = make_field("When facing difficult tasks, I am certain that I will accomplish them") o3 = make_field("In general, I think that I can obtain outcomes that are important to me") o4 = make_field("I believe I can succeed at almost any endeavor to which I set my mind.") o5 = make_field("I will be able to successfully overcome many challenges") o6 = make_field("I am confident that I can perform effectively on many different tasks") o7 = make_field("Compared to other people, I can do most tasks very well") o8 = make_field("Even when things are tough, I can perform quite well") #RatePart p1 = make_field2("My partner provides good emotional support") p2 = make_field2("I like my partner") p3 = make_field2("My partner was very helpful") p4 = make_field2("It was comforting talking to my partner") p5 = make_field2("My partner complains a lot") p6 = make_field2("I feel a strong bond with my partner") p7 = make_field2("I feel that my partner and I are quite similar") p8 = make_field2("My partner whines quite a bit") #RateSelf s1 = make_field2("I provided good emotional support to my partner") s2 = make_field2("I was very helpful to my partner") s3 = make_field2("My partner was comforted talking to me") s4 = make_field2("I complain a lot") s5 = make_field2("I whine quite a bit") #Meaning r1 = make_field2("Performing well in university is important to me") r2 = make_field2("Academic success is meaningful to me") r3 = make_field2("Studying hard is beneficial for my future") #AttentionCheck attn = make_field("Please select strongly disagree for this statement") #LOC loc1 = models.IntegerField( choices=[ [1, "Children get into trouble because their parents punish them too much."], [2, "The trouble with most children nowadays is that their parents are too easy with them."]], label='Select the statement that you agree with the most', widget=widgets.RadioSelect) loc2 = models.IntegerField( choices=[ [1, "Many of the unhappy things in people's lives are partly due to bad luck."], [2, "People's misfortunes result from the mistakes they make."]], label='Select the statement that you agree with the most', widget=widgets.RadioSelect) loc3 = models.IntegerField( choices=[ [1, "One of the major reasons why we have wars is because people don't take enough interest in politics."], [2, "There will always be wars, no matter how hard people try to prevent them."]], label='Select the statement that you agree with the most', widget=widgets.RadioSelect) loc4 = models.IntegerField( choices=[ [1, "In the long run people get the respect they deserve in this world"], [2, "Unfortunately, an individual's worth often passes unrecognized no matter how hard he or she tries"]], label='Select the statement that you agree with the most', widget=widgets.RadioSelect) loc5 = models.IntegerField( choices=[ [1, "The idea that teachers are unfair to students is nonsense"], [2, "Most students don't realize the extent to which their grades are influenced by accidental happenings"]], label='Select the statement that you agree with the most', widget=widgets.RadioSelect) loc6 = models.IntegerField( choices=[ [1, "Without the right breaks one cannot be an effective leader"], [2, "Capable people who fail to become leaders have not taken advantage of their opportunities"]], label='Select the statement that you agree with the most', widget=widgets.RadioSelect) loc7 = models.IntegerField( choices=[ [1, "No matter how hard you try some people just don't like you"], [2, "People who can't get others to like them don't understand how to get along with others"]], label='Select the statement that you agree with the most', widget=widgets.RadioSelect) loc8 = models.IntegerField( choices=[ [1, "Heredity plays the major role in determining one's personality"], [2, "It is one's experiences in life which determine what they're like"]], label='Select the statement that you agree with the most', widget=widgets.RadioSelect) loc9 = models.IntegerField( choices=[ [1, "I have often found that what is going to happen will happen"], [2, "Trusting to fate has never turned out as well for me as making a decision to take a definite course of action"]], label='Select the statement that you agree with the most', widget=widgets.RadioSelect) loc10 = models.IntegerField( choices=[ [1, "In the case of the well prepared student there is rarely if ever such a thing as an unfair test"], [2, "Many times exam questions tend to be so unrelated to course work that studying in really useless"]], label='Select the statement that you agree with the most', widget=widgets.RadioSelect) loc11 = models.IntegerField( choices=[ [1, "Becoming a success is a matter of hard work, luck has little or nothing to do with it"], [2, "Getting a good job depends mainly on being in the right place at the right time"]], label='Select the statement that you agree with the most', widget=widgets.RadioSelect) loc12 = models.IntegerField( choices=[ [1, "The average citizen can have an influence in government decisions"], [2, "This world is run by the few people in power, and there is not much the little guy can do about it"]], label='Select the statement that you agree with the most', widget=widgets.RadioSelect) loc13 = models.IntegerField( choices=[ [1, "When I make plans, I am almost certain that I can make them work"], [2, "It is not always wise to plan too far ahead because many things turn out to be a matter of good or bad fortune anyhow"]], label='Select the statement that you agree with the most', widget=widgets.RadioSelect) loc14 = models.IntegerField( choices=[ [1, "There are certain people who are just no good"], [2, "There is some good in everybody"]], label='Select the statement that you agree with the most', widget=widgets.RadioSelect) loc15 = models.IntegerField( choices=[ [1, "In my case getting what I want has little or nothing to do with luck"], [2, "Many times we might just as well decide what to do by flipping a coin"]], label='Select the statement that you agree with the most', widget=widgets.RadioSelect) loc16 = models.IntegerField( choices=[ [1, "Who gets to be the boss often depends on who was lucky enough to be in the right place first"], [2, "Getting people to do the right thing depends upon ability. Luck has little or nothing to do with it"]], label='Select the statement that you agree with the most', widget=widgets.RadioSelect) loc17 = models.IntegerField( choices=[ [1, "As far as world affairs are concerned, most of us are the victims of forces we can neither understand, nor control"], [2, "By taking an active part in political and social affairs the people can control world events"]], label='Select the statement that you agree with the most', widget=widgets.RadioSelect) loc18 = models.IntegerField( choices=[ [1, "Most people don't realize the extent to which their lives are controlled by accidental happenings"], [2, "There really is no such thing as 'luck'"]], label='Select the statement that you agree with the most', widget=widgets.RadioSelect) loc19 = models.IntegerField( choices=[ [1, "One should always be willing to admit mistakes"], [2, "It is usually best to cover up one's mistakes"]], label='Select the statement that you agree with the most', widget=widgets.RadioSelect) loc20 = models.IntegerField( choices=[ [1, "It is hard to know whether or not a person really likes you"], [2, "How many friends you have depends upon how nice a person you are"]], label='Select the statement that you agree with the most', widget=widgets.RadioSelect) loc21 = models.IntegerField( choices=[ [1, "In the long run the bad things that happen to us are balanced by the good ones"], [2, "Most misfortunes are the result of lack of ability, ignorance, laziness, or all three"]], label='Select the statement that you agree with the most', widget=widgets.RadioSelect) loc22 = models.IntegerField( choices=[ [1, "With enough effort we can wipe out political corruption"], [2, "It is difficult for people to have much control over the things politicians do in office"]], label='Select the statement that you agree with the most', widget=widgets.RadioSelect) loc23 = models.IntegerField( choices=[ [1, "Sometimes I can't understand how teachers arrive at the grades they give"], [2, "There is a direct connection between how hard I study and the grades I get"]], label='Select the statement that you agree with the most', widget=widgets.RadioSelect) loc24 = models.IntegerField( choices=[ [1, "A good leader expects people to decide for themselves what they should do"], [2, "A good leader makes it clear to everybody what their jobs are"]], label='Select the statement that you agree with the most', widget=widgets.RadioSelect) loc25 = models.IntegerField( choices=[ [1, "Many times I feel that I have little influence over the things that happen to me"], [2, "It is impossible for me to believe that chance or luck plays an important role in my life"]], label='Select the statement that you agree with the most', widget=widgets.RadioSelect) loc26 = models.IntegerField( choices=[ [1, "People are lonely because they don't try to be friendly"], [2, "There's not much use in trying too hard to please people, if they like you, they like you"]], label='Select the statement that you agree with the most', widget=widgets.RadioSelect) loc27 = models.IntegerField( choices=[ [1, "There is too much emphasis on athletics in high school"], [2, "Team sports are an excellent way to build character"]], label='Select the statement that you agree with the most', widget=widgets.RadioSelect) loc28 = models.IntegerField( choices=[ [1, "What happens to me is my own doing"], [2, "Sometimes I feel that I don't have enough control over the direction my life is taking"]], label='Select the statement that you agree with the most', widget=widgets.RadioSelect) loc29 = models.IntegerField( choices=[ [1, "Most of the time I can't understand why politicians behave the way they do"], [2, "In the long run the people are responsible for bad government on a national as well as on a local level"]], label='Select the statement that you agree with the most', widget=widgets.RadioSelect) #Self Report CAP CAP = models.FloatField(label="My current CAP score is:") ExCAP = models.FloatField(label="My anticipated CAP score at the end of my education at NUS is:") age = models.IntegerField(label="Your age:") gender = models.IntegerField( choices=[ [1, 'Male'], [2, 'Female'], ] ) SES = models.IntegerField( choices=[10, 9, 8, 7, 6, 5, 4, 3, 2, 1], label="", widget=widgets.RadioSelect ) YoS = models.IntegerField( choices=[ [1, "Year 1"], [2, "Year 2"], [3, "Year 3"], [4, "Year 4"], [5, "Year 5"] ], label="Year of Study", widget=widgets.RadioSelect ) CoS = models.StringField(label="Please state your course of study:") Matric = models.StringField(label="Matriculation No.:") Email = models.StringField(label="Email:") Susp = models.LongStringField(label="Were you suspicious about anything during the study? Write 'Nil' if you have none.")