nodebb-plugin-poll icon indicating copy to clipboard operation
nodebb-plugin-poll copied to clipboard

Multiples Poll's per thread

Open leoGalani opened this issue 8 years ago • 6 comments

Would be awesome to have multiples poll's per thread :+1: :)

leoGalani avatar Sep 22 '16 07:09 leoGalani

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 of pollId), 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)

Schamper avatar Sep 22 '16 08:09 Schamper

For what reason would someone want multiple polls per thread?

yariplus avatar Sep 23 '16 19:09 yariplus

Imagine if you have a thread for "Oscar Winners"... you could have a pool for each award ( best movie, best actor, ..etc)

leoGalani avatar Oct 10 '16 14:10 leoGalani

Oh okay. Sorry, I misunderstood. I thought you wanted polls in any post. Multiple polls in the main post makes sense to me. +1

yariplus avatar Oct 10 '16 16:10 yariplus

This will be awesome to be able to add multiple polls in 1 TOPIC. Please add this?

FaizanZahid avatar May 23 '18 16:05 FaizanZahid

Me to! This cool feature!

ferumdev avatar Mar 06 '23 12:03 ferumdev