I think this makes sense.
Concerning the rejoinder(s)
I think that regardless of whether it was possible to change the results directly, there will always potentially be points at which the poll is incorrect. It would be more unprofessional to edit the results of a poll without posting an explanation. The more transparency the better as far as polling is concerned I reckon.
That said, as has been alluded to, there is a difference between being able to edit poll results directly and removing a user’s votes if the user is deleted. Also, having the correct count for posterity is useful, particularly if the poll is being used for sensitive things like an election (i.e. in the context of my elections plugin).
Given that I also have a need for having the ability to remove a user’s votes when deleting their account, so I’ve made a plugin that extends the polls plugin.
x-discourse-poll adds a total count of a user’s poll votes to the admin user view and a ‘delete all poll votes’ action.
‘Delete all poll votes’ is similar to the ‘delete all posts’ action in structure.
For the deletion of poll votes it uses a background job to
- remove all votes of the user;
- update the votes count for the relevant poll options; and
- update the the voter count for relevant polls.
I’ve tested it with all 3 vote types.
By default the action is restricted to admins. The plugin has a setting - poll_allow_moderators_to_delete_votes
- to allow mods to perform the action.
When the action is taken a staff action is logged with the details of all poll votes deleted.
The details contains a list with post_id, poll_id and option_id of each vote deleted.