nodebb-plugin-poll
nodebb-plugin-poll copied to clipboard
Multiples Poll's per thread
Would be awesome to have multiples poll's per thread :+1: :)
Some concerns I can currently think of:
- The poll editor currently only supports a single poll per post. It attempts to parse any poll markup in a post so you can edit it. Possible solution would be to simple support multiple polls/markup. E.g. have a button "add another poll" at the bottom.
- Don't know if the serializer currently supports multiple poll markup, would have to check/fix.
- Rendering multiple polls should be a fairly easy modification
- The hard part: currently poll ID's are linked to a post/topic as a field in the post/topic data structure. This has the benefit that it's included whenever a post/topic is loaded by the client, by which we can load the actual poll. This ensures that we're not doing unnecessary network requests to check if there's a poll. I can think of some ways to solve this (e.g.
hasPoll
field instead ofpollId
), but it'd require reworking some core stuff, in addition to breaking current polls (which can be resolved with updating all the database entries, but still). Another solution could be enriching the post data using a hook, instead of relying on inserting custom fields in there. The latter might be the preferred way. (less prone to breaking by NodeBB updates)
For what reason would someone want multiple polls per thread?
Imagine if you have a thread for "Oscar Winners"... you could have a pool for each award ( best movie, best actor, ..etc)
Oh okay. Sorry, I misunderstood. I thought you wanted polls in any post. Multiple polls in the main post makes sense to me. +1
This will be awesome to be able to add multiple polls in 1 TOPIC. Please add this?
Me to! This cool feature!