Skip to content

Commit

Permalink
Merge pull request hackclub#344 from hackclub/add-1st-survey-of-2018-q1
Browse files Browse the repository at this point in the history
Add 1st survey of 2018 q1
  • Loading branch information
maxwofford authored Feb 6, 2018
2 parents 5e327d6 + 85894e5 commit 86141b5
Show file tree
Hide file tree
Showing 2 changed files with 147 additions and 18 deletions.
132 changes: 119 additions & 13 deletions api/app/models/hackbot/interactions/check_in.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,60 @@ def start
deadline = formatted_deadline leader
key = 'greeting.' + (first_check_in? ? 'if_first_check_in' : 'default')
key = 'greeting.restart' if @restart

msg_channel copy(key,
first_name: first_name,
flavor_text: flavor_text,
deadline: deadline)
msg_channel copy('nps.introduction')
msg_channel copy('nps.score')

default_follow_up 'wait_for_nps_score'
:wait_for_nps_score
end

def wait_for_nps_score
return :wait_for_nps_score unless msg

unless integer?(msg)
msg_channel copy('nps.invalid')
return :wait_for_nps_score
end

nps_score = msg.to_i

unless (0..10).cover?(nps_score)
msg_channel copy('nps.out_of_bounds')
return :wait_for_nps_score
end

data['nps_score'] = nps_score

msg_channel copy('nps.score_confirmation', score: nps_score)
msg_channel copy('nps.improve')

default_follow_up 'wait_for_nps_improve'
:wait_for_nps_improve
end

def wait_for_nps_improve
return unless msg

data['something_we_can_improve'] = msg

msg_channel copy('nps.did_well')

default_follow_up 'wait_for_nps_did_well'
:wait_for_nps_did_well
end

def wait_for_nps_did_well
return unless msg

data['something_we_did_well'] = msg

msg_channel copy('nps.completed')

actions = []

if previous_meeting_day
Expand All @@ -38,16 +92,13 @@ def start
actions << { text: 'No' }

msg_channel(
text: copy(key, first_name: first_name,
deadline: deadline,
flavor_text: flavor_text),
text: copy('meeting_confirmation.question'),
attachments: [
actions: actions
]
)

default_follow_up 'wait_for_meeting_confirmation'

:wait_for_meeting_confirmation
end

Expand Down Expand Up @@ -268,15 +319,70 @@ def wait_for_attendance
copy('judgement.amazing')
end

msg_channel(
text: copy('attendance.valid', judgement: judgement),
attachments: [
actions: [
{ text: 'Yes' },
{ text: 'No' }
]
]
)
msg_channel text: copy('attendance.valid', judgement: judgement)
msg_channel copy('demographics.introduction')
msg_channel copy('demographics.women')

default_follow_up 'wait_for_women_demographics'
:wait_for_women_demographics
end

def wait_for_women_demographics
msg_wo_percent_sign = msg.tr('%', '')

unless integer?(msg_wo_percent_sign) && msg.include?('%')
msg_channel copy('demographics.not_percentage')

default_follow_up 'wait_for_women_demographics'
return :wait_for_women_demographics
end

percent = msg_wo_percent_sign.to_i
unless (0..100).cover?(percent)
msg_channel copy('demographics.out_of_bounds', percent: percent)

default_follow_up 'wait_for_women_demographics'
return :wait_for_women_demographics
end

data['percent_women'] = percent
msg_channel copy('demographics.confirm_recorded',
percent: percent,
metric: 'women')
msg_channel copy('demographics.racial_minority')

default_follow_up 'wait_for_racial_minority_demographics'
:wait_for_racial_minority_demographics
end

def wait_for_racial_minority_demographics
msg_wo_percent_sign = msg.tr('%', '')
unless integer?(msg_wo_percent_sign) && msg.include?('%')
msg_channel copy('demographics.not_percentage')

default_follow_up 'wait_for_racial_minority_demographics'
return :wait_for_racial_minority_demographics
end

percent = msg_wo_percent_sign.to_i
unless (0..100).cover?(percent)
msg_channel copy('demographics.out_of_bounds', percent: percent)

default_follow_up 'wait_for_racial_minority_demographics'
return :wait_for_racial_minority_demographics
end

data['percent_racial_minority'] = percent
msg_channel copy('demographics.confirm_recorded',
percent: percent,
metric: 'not white or Asian')
msg_channel(text: copy('demographics.finished'),
attachments: [
actions: [
{ text: 'Yes' },
{ text: 'No' }
]
])

default_follow_up 'wait_for_notes_confirmation'
:wait_for_notes_confirmation
Expand Down
33 changes: 28 additions & 5 deletions api/lib/data/copy/check_in.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ greeting:
Hey <%= first_name %>! I'm Orpheus, Hack Club's friendly robot dinosaur.
I'll be reaching out to you every week, typically on Fridays, to check in and see how your club's doing. I'll be in the loop every step of the way 🙂
To start, did you have a club meeting this week?
default: |
Hey <%= first_name %>, <%= flavor_text %>
Let's get started — please be sure to complete this check-in by <%= deadline %>. Did your club meet this week?
restart: Let's start again! Did your club meet this week?
Please be sure to complete this check-in by <%= deadline %>.
restart: Let's restart
dormant:
text: Hey! We've been getting feedback that a lot of schools are heading into summer and/or exams right now, and are no longer planning on meeting this school year. Basically, if you're one of these leaders, we'd like to give you a way to opt-out of check-ins. So, are you on a school break right now and not planning on meeting until the next school year?
actions:
Expand All @@ -27,6 +25,16 @@ greeting:
- you're a star ★️!
- you're looking great today! 👀

nps:
introduction: We just got out of a major funding crisis last semester, so now we have some room to grow as an organization and get better at what we're doing. As part of that it'd be really helpful to know how we've done so far.
score: Assuming you had a friend at another high school that was technical, how likely is it that you would recommend starting a Hack Club to them? Please answer from 0 to 10, where 0 is not likely at all and 10 is very likely.
score_confirmation: You picked *<%= score %>*
invalid: I'm not very smart, so I can only understand numbers like `0` and `10`.
out_of_bounds: Make sure the number is from 0 to 10.
improve: What is one way you would improve Hack Club if you had a month, enough money to live, and no other obligations?
did_well: What is one thing Hack Club did particularly well this past semester?
completed: Thanks for the info. Now back to our regularly scheduled check-in...

is_dormant:
positive:
text: That's cool. When will your break end? (Say something like "in two months")
Expand All @@ -39,6 +47,7 @@ resurrection_date:
success: Awesome! I'll be in touch a few weeks before then. Please let the Hack Club staff know if you have any questions.

meeting_confirmation:
question: Did you have a club meeting this week?
had_meeting:
action_result: "✅ You had a meeting"
ask_day_of_week: Okay, sweet! On which day was it? (say something like "monday" or "today" – I'm not very clever)
Expand Down Expand Up @@ -72,7 +81,21 @@ attendance:
not_realistic:
negative: I'm going to need a positive number, silly. How many people came to the last meeting?
too_large: That number is too big for our database! How many people actually came to your last meeting?
valid: <%= judgement %> Is there anything the Hack Club team can be helpful with?
valid: <%= judgement %>

demographics:
introduction: Hack Club HQ is applying for a grant this week and the Motorola Foundation is asking for demographic info from every club, so I need to ask you a couple follow-up questions. Estimates are OK.
women: What percentage of your members are women?
racial_minority: What percentage are a racial minority in the technology industry, defined as not being white or Asian?
confirm_recorded:
- Okay, *<%= percent %>%* of your attendees are <%= metric %>.
- Got it. I've recorded that *<%= percent %>%* of your hackers are <%= metric %>.
- Gotcha, *<%= percent %>%* of your club's attendees are <%= metric %>.
- '*<%= percent %>%* of your club members are <%= metric %>.'
- I'm writing down that *<%= percent %>%* of your club members are <%= metric %>.
not_percentage: I don't understand that too well. Can you tell me in the format `x%` where x is a number from 0 to 100? For example, `75%`.
out_of_bounds: <%= percent %>%? Percentages should be from 0 to 100.
finished: Is there anything the Hack Club team can be helpful with?

notes_confirmation:
has_notes:
Expand Down

0 comments on commit 86141b5

Please sign in to comment.