from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range, ) author = 'Your name here' doc = """ Your app description """ class Constants(BaseConstants): name_in_url = 'grading_task_end' players_per_group = None completion_code = "COMPLETE123" num_rounds = 1 import random num1 = random.randint(1, 2) flag1 = (num1 == 1) oq9options = ['Consume caffeine / theine / taurine (or similar)', 'Drink water frequently', 'Have a light lunch', 'Get up and move / engage in physical activity', 'Go outside', 'Open the window / ventilate frequently', 'Meditate', 'Take a nap', 'Listen to music', 'Talk to colleagues, friends, family, …', 'Chew gum'] oq23options = ['I completed the task in a noisy environment (without noise canceling devices)', 'I felt hungry while completing the task', 'I felt sick while completing the task', 'I felt worried while completing the task', 'I felt sad or depressed while completing the task', 'I felt happy while completing the task', 'I felt hot while completing the task', 'I felt cold while completing the task', 'I was able to complete the task uninterruptedly', 'None of the above'] class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): def CalculateAmount(self): filename = "mistakes" + str(self.id_in_group) + ".txt" misses = open(filename, "r") filename = "corrects" + str(self.id_in_group) + ".txt" corrects = open(filename, "r") misses = misses.read() corrects = corrects.read() misses = misses.split(",") del misses[-1] corrects = corrects.split(",") del corrects[-1] misNum = 0 for i in misses: i = int(i) misNum += i corNum = 0 for i in corrects: i = int(i) corNum += i misAm = misNum * 0.0074 corAm = corNum * 0.00185 earnedAmount = corAm - misAm return earnedAmount completion_code = models.StringField() postbeliefp1q1 = models.FloatField( label="The first 15 minutes [minutes 0-15]", doc="""label for question 1a""", blank=False, min=0 ) postbeliefp1q2 = models.FloatField( label="The second 15 minutes [minutes 15-30]", doc="""label for question 1b""", blank=False, min=0 ) postbeliefp1q3 = models.FloatField( label="The third 15 minutes [minutes 30-45]", doc="""label for question 1c""", blank=False, min=0 ) postbeliefp1q4 = models.FloatField( label="The last 15 minutes [minutes 45-60]", doc="""label for question 1d""", blank=False, min=0 ) postbeliefp1q5 = models.IntegerField( label="The first 15 minutes [minutes 0-15]", doc="""label for question 1a""", blank=False, min=0 ) postbeliefp1q6 = models.IntegerField( label="The second 15 minutes [minutes 15-30]", doc="""label for question 1b""", blank=False, min=0 ) postbeliefp1q7 = models.IntegerField( label="The third 15 minutes [minutes 30-45]", doc="""label for question 1c""", blank=False, min=0 ) postbeliefp1q8 = models.IntegerField( label="The last 15 minutes [minutes 45-60]", doc="""label for question 1d""", blank=False, min=0 ) earam = models.FloatField(initial=0) postBeliefFlag = models.IntegerField() postbeliefp2q1 = models.FloatField( label="The first 15 minutes [minutes 0-15]", doc="""label for question 1a""", blank=False, min=0 ) postbeliefp2q2 = models.FloatField( label="The second 15 minutes [minutes 15-30]", doc="""label for question 1b""", blank=False, min=0 ) postbeliefp2q3 = models.FloatField( label="The third 15 minutes [minutes 30-45]", doc="""label for question 1c""", blank=False, min=0 ) postbeliefp2q4 = models.FloatField( label="The last 15 minutes [minutes 45-60]", doc="""label for question 1d""", blank=False, min=0 ) postbeliefp2q5 = models.FloatField( label="The first 15 minutes [minutes 0-15]", doc="""label for question 1a""", blank=False, min=0 ) postbeliefp2q6 = models.FloatField( label="The second 15 minutes [minutes 15-30]", doc="""label for question 1b""", blank=False, min=0 ) postbeliefp2q7 = models.FloatField( label="The third 15 minutes [minutes 30-45]", doc="""label for question 1c""", blank=False, min=0 ) postbeliefp2q8 = models.FloatField( label="The last 15 minutes [minutes 45-60]", doc="""label for question 1d""", blank=False, min=0 ) postbeliefp2q9 = models.IntegerField( label="The first 15 minutes [minutes 0-15]", doc="""label for question 1a""", blank=False, min=0 ) postbeliefp2q10 = models.IntegerField( label="The second 15 minutes [minutes 15-30]", doc="""label for question 1b""", blank=False, min=0 ) postbeliefp2q11 = models.IntegerField( label="The third 15 minutes [minutes 30-45]", doc="""label for question 1c""", blank=False, min=0 ) postbeliefp2q12 = models.IntegerField( label="The last 15 minutes [minutes 45-60]", doc="""label for question 1d""", blank=False, min=0 ) postbeliefp2q13 = models.IntegerField( label="The first 15 minutes [minutes 0-15]", doc="""label for question 1a""", blank=False, min=0 ) postbeliefp2q14 = models.IntegerField( label="The second 15 minutes [minutes 15-30]", doc="""label for question 1b""", blank=False, min=0 ) postbeliefp2q15 = models.IntegerField( label="The third 15 minutes [minutes 30-45]", doc="""label for question 1c""", blank=False, min=0 ) postbeliefp2q16 = models.IntegerField( label="The last 15 minutes [minutes 45-60]", doc="""label for question 1d""", blank=False, min=0 ) oq1 = models.StringField( choices=[['5 to 6.29 AM', '5 to 6.29 AM'], ['6.30 to 7.44 AM', '6.30 to 7.44 AM'], ['7.45 to 9.44 AM', '7.45 to 9.44 AM'], ['9.45 to 10.59 AM', '9.45 to 10.59 AM'], ['11 to 11.59 PM', '11 to 11.59 PM'], ['12 PM to 5 AM', '12 PM to 5 AM']], label='1. Considering only your own "feeling beat" rhythm, at what time would you get up if you were entirely free to plan your day?', widget=widgets.RadioSelect, blank=True ) oq2 = models.StringField( choices=[['Very tired', 'Very tired'], ['Fairly tired', 'Fairly tired'], ['Fairly refreshed', 'Fairly refreshed'], ['Very refreshed', 'Very refreshed']], label='2. During the first half-hour after having woken in the morning, how tired do you feel?', widget=widgets.RadioSelect, blank=True ) oq3 = models.StringField( choices=[['8 to 8.59 PM', '8 to 8.59 PM'], ['9 to 10.14 PM', '9 to 10.14 PM'], ['10.15 PM to 12.44 AM', '10.15 PM to 12.44 AM'], ['12.45 to 1.59 AM', '12.45 to 1.59 AM'], ['2 to 3 AM', '2 to 3 AM'], ['3 AM to 8 PM', '3 AM to 8 PM']], label='3. At what time in the evening do you feel tired and as a result in need of sleep?', widget=widgets.RadioSelect, blank=True ) oq4 = models.StringField( choices=[['5 to 7.59 AM', '5 to 7.59 AM'], ['8 to 9.59 AM', '8 to 9.59 AM'], ['10 AM to 4.59 PM', '10 AM to 4.59 PM'], ['5 to 9.59 PM', '5 to 9.59 PM'], ['10 PM to 4.59 AM', '10 PM to 4.59 AM']], label='4. At what time of the day do you think that you reach your "feeling best" peak?', widget=widgets.RadioSelect, blank=True ) oq5 = models.StringField( choices=[['Definitely a "morning" type', 'Definitely a "morning" type'], ['Rather more a "morning" than an "evening" type', 'Rather more a "morning" than an "evening" type'], ['Rather more an "evening" than a "morning" type', 'Rather more an "evening" than a "morning" type'], ['Definitely an "evening" type', 'Definitely an "evening" type']], label='5. One hears about "morning" and "evening" types of people. Which ONE of these types do you consider yourself to be?', widget=widgets.RadioSelect, blank=True ) oq6 = models.StringField( choices=[['Very much so', 'Very much so'], ['Somewhat', 'Somewhat'], ['Not really', 'Not really']], label='6. In general, do you think you have a good sense about how your work performance is evolving throughout the day?', widget=widgets.RadioSelect, blank=True ) oq7 = models.StringField( choices=[['Very much so', 'Very much so'], ['Somewhat', 'Somewhat'], ['Not really', 'Not really']], label='7. In general, are you tweaking your to-dos based on your peak productivity times (i.e. scheduling the most demanding tasks for when you are at your best)?', widget=widgets.RadioSelect, blank=True ) oq8 = models.StringField( choices=[['Very much so', 'Very much so'], ['Somewhat', 'Somewhat'], ['Not really', 'Not really']], label='8. In general, do you think you have a good sense about when you need to take a break or stop working?', widget=widgets.RadioSelect, blank=True ) oq9 = models.StringField( choices=[['Consume caffeine / theine / taurine (or similar)', 'Consume caffeine / theine / taurine (or similar)'], ['Drink water frequently', 'Drink water frequently'], ['Have a light lunch', 'Have a light lunch'], ['Get up and move / engage in physical activity', 'Get up and move / engage in physical activity'], ['Go outside', 'Go outside'], ['Open the window / ventilate frequently', 'Open the window / ventilate frequently'], ['Meditate', 'Meditate'], ['Take a nap', 'Take a nap'], ['Listen to music', 'Listen to music'], ['Talk to colleagues, friends, family, …', 'Talk to colleagues, friends, family, …'], ['Chew gum', 'Chew gum']], label='9. In general, do you do any of the following when you are feeling tired or to avoid feeling tired? [Select all that apply.]', widget=widgets.RadioSelect, blank=True, ) oq10 = models.StringField( choices=[['Extremely tired', 'Extremely tired'], ['Moderately tired', 'Moderately tired'], ['Slightly tired', 'Slightly tired'], ['Slightly refreshed', 'Slightly refreshed'], ['Moderately refreshed', 'Moderately refreshed'], ['Extremely refreshed', 'Extremely refreshed']], label='9. How tired did you feel BEFORE you started working on this data entry task?', widget=widgets.RadioSelect, blank=True ) oq11 = models.StringField( choices=[['Extremely tired', 'Extremely tired'], ['Moderately tired', 'Moderately tired'], ['Slightly tired', 'Slightly tired'], ['Slightly refreshed', 'Slightly refreshed'], ['Moderately refreshed', 'Moderately refreshed'], ['Extremely refreshed', 'Extremely refreshed']], label='10. How tired did you feel AFTER you finished working on this data entry task?', widget=widgets.RadioSelect, blank=True ) oq12 = models.StringField( choices=[['Not annoying at all', 'Not annoying at all'], ['Slightly annoying', 'Slightly annoying'], ['Moderately annoying', 'Moderately annoying'], ['Extremely annoying', 'Extremely annoying']], label='11. How annoying would you rate this data entry task?', widget=widgets.RadioSelect, blank=True ) oq13 = models.StringField( choices=[['Annoyed early on (first 15 min) and then equally annoyed from thereon', 'Annoyed early on (first 15 min) and then equally annoyed from thereon'], ['Annoyed early on (first 15 min) but less and less annoyed from thereon', 'Annoyed early on (first 15 min) but less and less annoyed from thereon'], ['Annoyed early on (first 15 min) and increasingly annoyed from thereon', 'Annoyed early on (first 15 min) and increasingly annoyed from thereon'], ['Annoyed halfway through (around 30 min) and then equally annoyed from thereon', 'Annoyed halfway through (around 30 min) and then equally annoyed from thereon'], ['Annoyed halfway through (around 30 min) but less annoyed over time', 'Annoyed halfway through (around 30 min) but less annoyed over time'], ['Annoyed halfway through (around 30 min) and increasingly annoyed from thereon', 'Annoyed halfway through (around 30 min) and increasingly annoyed from thereon'], ['Annoyed late on (after 45 min) and then equally annoyed from thereon', 'Annoyed late on (after 45 min) and then equally annoyed from thereon'], ['Annoyed late on (after 45 min) but less and less annoyed from thereon', 'Annoyed late on (after 45 min) but less and less annoyed from thereon'], ['Annoyed late on (after 45 min) and increasingly annoyed from thereon', 'Annoyed late on (after 45 min) and increasingly annoyed from thereon']], label='12. [If you selected slightly/moderately/extremely annoying in Q11] How would you describe your annoyance levels during this task?', widget=widgets.RadioSelect, blank=True ) oq14 = models.StringField( choices=[['Considerably faster', 'Considerably faster'], ['Slightly faster', 'Slightly faster'], ['No change', 'No change'], ['Slightly slower', 'Slightly slower'], ['Considerably slower', 'Considerably slower']], label='13. Do you think you got faster or slower at transcribing images as time progressed?', widget=widgets.RadioSelect, blank=True ) oq15 = models.StringField( choices=[['Considerably more mistakes', 'Considerably more mistakes'], ['Slightly more mistakes', 'Slightly more mistakes'], ['No change', 'No change'], ['Slightly fewer mistakes', 'Slightly fewer mistakes'], ['Considerably fewer mistakes', 'Considerably fewer mistakes']], label='14. Do you think you made more or fewer mistakes as time progressed?', widget=widgets.RadioSelect, blank=True ) oq16 = models.StringField( choices=[['Daily', 'Daily'], ['At least once a week', 'At least once a week'], ['At least once a month', 'At least once a month'], ['At least once every few months', 'At least once every few months'], ['At least once a year', 'At least once a year'], ['Every few years', 'Every few years'], ['Never (this is the first time)', 'Never (this is the first time)']], label='15. How often do you work on data entry tasks?', widget=widgets.RadioSelect, blank=True ) oq17 = models.StringField( choices=[['Yes', 'Yes'], ['No', 'No']], label='16. Did you use OCR (optical character recognition) software to complete this data entry work?', widget=widgets.RadioSelect, blank=True ) oq18 = models.StringField( choices=[['Yes, for both letters and numbers', 'Yes, for both letters and numbers'], ['Yes, but only for letters', 'Yes, but only for letters'], ['Yes, but only for numbers', 'Yes, but only for numbers'], ['No', 'No']], label='17. Do you type without looking at the keyboard?', widget=widgets.RadioSelect, blank=True ) oq19 = models.StringField( choices=[['Yes', 'Yes'], ['No', 'No']], label='18. Do you type with 10 fingers?', widget=widgets.RadioSelect, blank=True ) oq20 = models.StringField( choices=[['QWERTY (standard in the U.S.)', 'QWERTY (standard in the U.S.)'], ['AZERTY (used in French speaking countries)', 'AZERTY (used in French speaking countries)'], ['QWERTZ (mostly used in Central Europe)', 'QWERTZ (mostly used in Central Europe)'], ['Dvorak', 'Dvorak'], ['Colemak', 'Colemak'], ['Maltron', 'Maltron'], ['JCUKEN (mostly used in Russia)', 'JCUKEN (mostly used in Russia)'], ['Other', 'Other']], label='19. What is the layout of your keyboard?', widget=widgets.RadioSelect, blank=True ) oq20b = models.StringField( label="If you entered 'Other', please specify", blank=True ) oq21 = models.StringField( choices=[['Yes', 'Yes'], ['No', 'No']], label='20. Does your keyboard have a number block?', widget=widgets.RadioSelect, blank=True ) oq22 = models.StringField( choices=[['Better than normal', 'Better than normal'], ['Normal', 'Normal'], ['Worse than normal', 'Worse than normal']], label='21. How would you rate your eyesight (after using eyesight corrections such as glasses and contact lenses) when it comes to looking at your computer screen?', widget=widgets.RadioSelect, blank=True ) oq23 = models.StringField( choices=[['I completed the task in a noisy environment (without noise canceling devices)', 'I completed the task in a noisy environment (without noise canceling devices)'], ['I felt hungry while completing the task', 'I felt hungry while completing the task'], ['I felt sick while completing the task', 'I felt sick while completing the task'], ['I felt worried while completing the task', 'I felt worried while completing the task'], ['I felt sad or depressed while completing the task', 'I felt sad or depressed while completing the task'], ['I felt happy while completing the task', 'I felt happy while completing the task'], ['I felt hot while completing the task', 'I felt hot while completing the task'], ['I felt cold while completing the task', 'I felt cold while completing the task'], ['I was able to complete the task uninterruptedly', 'I was able to complete the task uninterruptedly'], ['None of the above', 'None of the above']], label='23. Please select all that apply:', widget=widgets.RadioSelect, blank=True, ) oq24 = models.StringField( choices=[['Female', 'Female'], ['Male', 'Male'], ['Non-binary', 'Non-binary'], ['Prefer not to say', 'Prefer not to say']], label='22. With which gender identity do you most identify?', widget=widgets.RadioSelect, blank=True ) oq25 = models.StringField( choices=[['18-24', '18-24'], ['25-34', '25-34'], ['35-44', '35-44'], ['45-54', '45-54'], ['55-64', '55-64'], ['65 or older', '65 or older']], label='23. How old are you?', widget=widgets.RadioSelect, blank=True ) oq26 = models.StringField( choices=[['Less than high school', 'Less than high school'], ['High school', 'High school'], ['Some college', 'Some college'], ['Associate degree', 'Associate degree'], ['Professional degree', 'Professional degree'], ["Bachelor's degree", "Bachelor's degree"], ["Advanced degree (ex. Master’s, doctorate)", "Advanced degree (ex. Master’s, doctorate)"]], label='24. What is the highest degree or level of school that you have completed?', widget=widgets.RadioSelect, blank=True ) oq27 = models.LongStringField( label='25. What do you think is the purpose of this study?', blank=True ) oq28 = models.LongStringField( label='26. Do you have any feedback that you would like to share?', blank=True ) numImages1 = models.IntegerField(initial=0) numImages2 = models.IntegerField(initial=0) numImages3 = models.IntegerField(initial=0) numImages4 = models.IntegerField(initial=0) oq9a = models.BooleanField(blank=True) oq9b = models.BooleanField(blank=True) oq9c = models.BooleanField(blank=True) oq9d = models.BooleanField(blank=True) oq9e = models.BooleanField(blank=True) oq9f = models.BooleanField(blank=True) oq9g = models.BooleanField(blank=True) oq9h = models.BooleanField(blank=True) oq9i = models.BooleanField(blank=True) oq9j = models.BooleanField(blank=True) oq9k = models.BooleanField(blank=True) oq9l = models.BooleanField(blank=True) oq23a = models.BooleanField(blank=True, label='I completed the task in a noisy environment (without noise canceling devices)') oq23b = models.BooleanField(blank=True, label='I felt hungry while completing the task') oq23c = models.BooleanField(blank=True, label='I felt sick while completing the task') oq23d = models.BooleanField(blank=True, label='I felt worried while completing the task') oq23e = models.BooleanField(blank=True, label='I felt sad or depressed while completing the task') oq23f = models.BooleanField(blank=True, label='I felt happy while completing the task') oq23g = models.BooleanField(blank=True, label='I felt hot while completing the task') oq23h = models.BooleanField(blank=True, label='I felt cold while completing the task') oq23i = models.BooleanField(blank=True, label='I was able to complete the task uninterruptedly') oq23j = models.BooleanField(blank=True, label='None of the above') ScreenTimeString = models.StringField() MistakesPerScreen = models.StringField()