-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsurveys.py
54 lines (43 loc) · 1.58 KB
/
surveys.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
class Question:
"""Question on a questionnaire."""
def __init__(self, question, choices=None, allow_text=False):
"""Create question (assume Yes/No for choices)."""
if not choices:
choices = ["Yes", "No"]
self.question = question
self.choices = choices
self.allow_text = allow_text
class Survey:
"""Questionnaire."""
def __init__(self, title, instructions, questions):
"""Create questionnaire."""
self.title = title
self.instructions = instructions
self.questions = questions
satisfaction_survey = Survey(
"Customer Satisfaction Survey",
"Please fill out a survey about your experience with us.",
[
Question("Have you shopped here before?"),
Question("Did someone else shop with you today?"),
Question("On average, how much do you spend a month on frisbees?",
["Less than $10,000", "$10,000 or more"]),
Question("Are you likely to shop here again?"),
])
personality_quiz = Survey(
"Rithm Personality Test",
"Learn more about yourself with our personality quiz!",
[
Question("Do you ever dream about code?"),
Question("Do you ever have nightmares about code?"),
Question("Do you prefer porcupines or hedgehogs?",
["Porcupines", "Hedgehogs"]),
Question("Which is the worst function name, and why?",
["do_stuff()", "run_me()", "wtf()"],
allow_text=True),
]
)
surveys = {
"satisfaction": satisfaction_survey,
"personality": personality_quiz,
}