You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ifnotisinstance(response, int) orresponse<0orresponse>10: # Adjust range as needed
102
+
raiseValueError(f"Response must be an integer between 0 and 10 for question: {self.question_text}")
103
+
returnTrue
104
+
105
+
# Creating blocks and questions
106
+
107
+
# Demographics Block
108
+
demographics=Block("Demographics", [])
109
+
demographics.add_question(Question("Age", "What is your age?", "open_ended"))
110
+
demographics.add_question(Question("Year", "What year are you in college?", "multiple_choice",
111
+
["First Year (1)", "Sophomore (2)", "Junior (3)", "Senior (4)", "5+ Years (5)"]))
112
+
demographics.add_question(Question("Ethnicity", "Are you of Spanish, Hispanic, or Latino origin?", "multiple_choice",
113
+
["Yes (1)", "No (2)"]))
114
+
demographics.add_question(Question("Race", "Choose one or more races that you consider yourself to be", "multiple_choice",
115
+
["White or Caucasian (1)", "Black or African American (2)",
116
+
"American Indian/Native American or Alaska Native (3)", "Asian (4)",
117
+
"Native Hawaiian or Other Pacific Islander (5)", "Other (6)",
118
+
"Prefer not to say (7)"]))
119
+
demographics.add_question(Question("Household_Income", "What was your total household income before taxes during the past 12 months?", "multiple_choice",
120
+
["Less than $25,000 (1)", "$25,000-$49,999 (2)", "$50,000-$74,999 (3)",
121
+
"$75,000-$99,999 (4)", "$100,000-$149,999 (5)", "$150,000 or more (6)",
demographics_political.add_question(Question("Election", "Do you plan to vote in the upcoming 2024 election?", "multiple_choice",
127
+
["Yes (1)", "No (2)"]))
128
+
demographics_political.add_question(Question("Party_Affiliation", "Generally speaking, do you usually think of yourself as a Republican, a Democrat, an Independent, or something else?", "multiple_choice",
demographics_political.add_question(Question("R_Strength", "Would you call yourself a strong Republican or a not very strong Republican?", "multiple_choice",
131
+
["Strong (1)", "Not very strong (2)"]))
132
+
demographics_political.add_question(Question("D_Strength", "Would you call yourself a strong Democrat or a not very strong Democrat?", "multiple_choice",
133
+
["Strong (1)", "Not very strong (2)"]))
134
+
demographics_political.add_question(Question("Independent_Lean", "Do you think of yourself as closer to the Republican or Democratic party?", "multiple_choice",
135
+
["Republican (1)", "Democratic (2)"]))
136
+
demographics_political.add_question(Question("Political_Views", "Here is a 7-point scale on which the political views that people might hold are arranged from extremely liberal (left) to extremely conservative (right). Where would you place yourself on this scale?", "scale",
137
+
["0", "1", "2", "3", "4", "5", "6", "7"]))
138
+
demographics_political.add_question(Question("Party_Registration", "What political party are you registered with, if any?", "multiple_choice",
personal_political=Block("Personal Political Characteristics", [])
143
+
personal_political.add_question(Question("P_Efficacy", "For each question below, please choose the response that best reflects how you feel.", "likert_scale",
personal_political.add_question(Question("P_Knowledge_Intro", "Here are a few questions about the federal government. Many people don't know the answers to these questions, so if there are some you don't know, just provide your best guess.", "intro"))
146
+
personal_political.add_question(Question("P_Knowledge_1", "Do you happen to know what job or political office is now held by Kamala Harris?", "open_ended"))
147
+
personal_political.add_question(Question("P_Knowledge_2", "Whose responsibility is it to determine if a law is constitutional or not? Is it the president, the Congress, or the Supreme Court?", "multiple_choice",
148
+
["President", "Congress", "Supreme Court"]))
149
+
personal_political.add_question(Question("P_Knowledge_3", "How much of a majority is required for the U.S. Senate and House to override a presidential veto?", "open_ended"))
150
+
personal_political.add_question(Question("P_Knowledge_4", "Do you happen to know which party has the most members in the House of Representatives currently?", "open_ended"))
151
+
personal_political.add_question(Question("P_Knowledge_5", "Would you say that one of the parties is more conservative than the other at the national level? Which party is more conservative?", "open_ended"))
152
+
153
+
# Perception of News Sources Block
154
+
perception_news=Block("Perception of News Sources", [])
155
+
# Add all the news sources as individual questions here. For brevity, only one example is shown:
media_consumption.add_question(Question("News_frequency", "How often do you consume news?", "multiple_choice",
169
+
["Daily", "A few times a week", "Once a week", "A few times a month", "Rarely", "Never"]))
170
+
171
+
# Misinformation Threat Block
172
+
misinformation_threat=Block("Mis_Threat", [])
173
+
misinformation_threat.add_question(Question("Disinfo_threat", "On the scale from 0 to 10, where 0 means no risk and 10 means extreme risk, how would you rate the risk of disinformation campaigns to each of the following?", "scale",
misinformation_threat.add_question(Question("Disinfo_Res", "In your opinion, who is primarily responsible for combating disinformation?", "multiple_choice",
0 commit comments