Skip to content

Commit

Permalink
- add the responses as options to be consistent with other poll types
Browse files Browse the repository at this point in the history
  • Loading branch information
ritzalam committed Jun 22, 2023
1 parent 98c4d3c commit 24a4814
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/bbbevents/events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ def user_responded_to_poll_record_event(e)
if poll = @polls[poll_id]
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]
end
Expand Down

0 comments on commit 24a4814

Please sign in to comment.