Skip to content

Commit

Permalink
- add test file for typed response poll
Browse files Browse the repository at this point in the history
  • Loading branch information
ritzalam committed Jun 23, 2023
1 parent 24a4814 commit e878299
Show file tree
Hide file tree
Showing 3 changed files with 757 additions and 11 deletions.
9 changes: 3 additions & 6 deletions lib/bbbevents/events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,10 @@ def user_responded_to_poll_record_event(e)
if poll.type == 'R-'
poll.votes[@externalUserId[intUserId]] = e["answer"]

# We want to merge the same responses
poll_set = poll.options.to_set
poll_set.add(e["answer"])
poll.options = poll_set.to_a
else
poll.votes[@externalUserId[intUserId]] = poll.options[e["answerId"].to_i]
# We want to store the responses as options.
poll.options.insert(e["answerId"].to_i, e["answer"])
end
poll.votes[@externalUserId[intUserId]] = poll.options[e["answerId"].to_i]
end

attendee.engagement[:poll_votes] += 1
Expand Down
Loading

0 comments on commit e878299

Please sign in to comment.