Plugin de questions-réponses

Excellent info, thanks for writing up a detailed description @angus I feel much more comfortable utilizing the plugin after understanding sort_order.

Plugin-builder newbie question - is there a significant time implication to altering the UI for this plugin (moddifying core, etc.)? Happy to help contribute, I just wanted to understand the complexity in altering the UI to look something like this:

1 « J'aime »

I really need to let my users vote more than once per topic (e.g. for different responses).
Would it be possible to allow for this? e.g. with an opt-in setting like:

qa number of votes per user per topic e.g. “5” - (default “1”, “0”- unlimited) - how many responses a user can vote for.

3 « J'aime »

It’s possible :slight_smile: I won’t have the time to do this till next week though.

2 « J'aime »

Angus McLeod
May I please have some few screenshots for the plugin
Does it support anonymous answer ? if not , can it be customisable ?
Thanks

Sorry, I missed a few questions here.

Overall, I have to give my apologies in terms of doing new work on this plugin. I’m happy to fix bugs with the existing functionality (I just fixed an issue with time-gaps), but for new features this plugin is near the bottom of my priority list.

If you want to add more features / customisations here your best bet is to get someone with some standard frontend skills. If that someone gets stuck with the logic of the plugin itself I’m happy to help them out understanding it.


@dalerka Those changes the voter list are possible, but are slightly harder than they may first seem as this plugin uses an existing structure in Discourse called “Post Actions” to display the voter list. So it would require some JS changes as well.

@supernaturally The UI part of the change to the vote buttons would not be that hard to do, but down-voting would be a new feature.

You can see it in action, and try it out, on my sandbox in the QA category, e.g.
https://discourse.angusmcleod.com.au/t/what-has-cities-but-no-houses-forests-but-no-trees-and-water-but-no-fish/55/4

It should support anonymous answers (I haven’t tested it with anonymous users extensively though), as it has all the features of a normal Discourse topic, which allows a user to post anonymously if the “allow anonymous posting” site setting is turned on.

5 « J'aime »

Does this plugin’s vote count carry over to comments embedded into a wordpress site via the WP Discourse plugin? Does the resorting of comments based on votes impact order of comments embedded in wordpress site? I am thinking not. I imagine once comments are resorted per votes in the forum, the comments could be manually reimported to wordpress.

Has anyone tried these two plugins together?

Thanks in advance.

I’ve never used the WP plugin before, but in theory the only thing you’d need to do to get a ‘read only’ version within Wordpress (i.e. you can’t vote, or clicking a ‘vote button’ would send you to the discourse topic itself) would be to customise the WP comment template to support the QA styles.

The key bits would be:

1 - If a topic has qa enabled and the post is not the first post, it’s a ‘comment’ if it’s a reply to a post and it’s an ‘answer’ if its not. This is the version of this logic in the Discourse client customisations in this plugin:

api.addPostClassesCallback((attrs) => {
  if (attrs.topic.qa_enabled && !attrs.firstPost) {
    return attrs.reply_to_post_number ? ["comment"] : ["answer"];
  };
});

2 - Display the property topic.vote_count alongside answers.

The posts should already be in the right order as this plugin changes the sort_order of posts in a topic, which should be respected regardless of what client is consuming the server endpoints (i.e. the Discourse client, or the Wordpress plugin).

5 « J'aime »

This is a great plugin, Angus. Thanks. :pray:

Sounds like you are onto other things now. Good for you. Have you ever considered programming the plugin so members can change their vote to another answer if a better answer comes along as the discussion on a topic grows over time? Kinda like how you can unlike content by clicking on the heart icon a second time?

Actually, this might work too:

P.S. I will be using wp discourse and the q/a plugin together and will report in here to let you know how it goes. I imagine the prioritization of order of content based on membership consensus would be a nice complement to the settings in the wp discourse plugin where you can set the criteria in a number of ways for what gets embedded from the topic into wordpress blogs.

1 « J'aime »

Um, could you please give screenshots of the plugin? I am thinking of suggesting it to a forum that I am on, but I want to know how it looks first.

Try this, @Yusamac205

2 « J'aime »

Great! Let me know how it goes.

You can change your vote by clicking ‘Undo vote’ on a post you’ve voted for

Screenshot%20at%20Feb%2026%2021-58-28.

This behaviour is actually part of core Discourse itself, it’s just not currently used. This plugin uses the latent voting logic in core Discourse where it can, this being one instance.

As @McBlu noted, you can see this plugin in action on my sandbox, e.g

https://discourse.angusmcleod.com.au/t/can-you-solve-aldhelms-lorica/59

If you’re considering using this, please note that I’m not currently devoting much time to this plugin, and:

3 « J'aime »

Merci, @angus. Je vois cette ligne.

Et lorsque je clique dessus, la ligne devient celle-ci :

Et il n’y a aucune option pour annuler le vote. Autrement dit, cela n’apparaît pas :

Voici ce que j’ai vérifié dans les paramètres :

J’ai installé la version 0.2 par Communiteq (anciennement DiscourseHosting).

1 « J'aime »

Ah yes, there’s a time limit to undoing post actions (‘voting’ is a type of ‘post action’, like ‘liking’). I can’t check the code right now (it may be something like 5 minutes). Increasing this limit won’t be too hard, so if it helps I’ll add this in as a setting tomorrow.

1 « J'aime »

Thanks, Angus, I’ll keep testing the undo function to see what happens.

Which setting are you adding tomorrow?

This plugin is awesome, btw.

Sorry, I mean I’ll add a setting for increasing the time limit on changing your vote (including making it always possible).

2 « J'aime »

Super, Angus. Merci. Ce serait formidable. Dans mon cas, j’ai accidentellement supprimé un message en essayant d’annuler un vote, donc je peux imaginer que des gens votent par erreur et souhaitent simplement annuler cela sur le moment. Dans ce cas, pouvoir l’annuler immédiatement serait idéal.

J’ai vu dans un message précédent que vous envisagiez d’ajouter un paramètre permettant de définir le nombre de votes par sujet qu’un membre peut effectuer (désolé si j’ai mal compris). Est-ce exact ?

J’ai l’impression que vous avez terminé le développement de ce plugin et que vous passez à d’autres projets. De tous les plugins, c’est celui pour lequel je financerais des améliorations si j’avais les moyens. Il est fantastique et complète parfaitement le plugin WP Discourse qui intègre des commentaires dans les blogs selon les critères que vous avez définis. Avec votre plugin, les membres peuvent influencer de manière significative ce qui arrive en haut des commentaires.

P.S. La fonction d’annulation ne fonctionne pas pour les votes effectués hier. J’ai contacté Communiteq (anciennement DiscourseHosting) pour savoir quelle version du plugin Q/A est installée. Il est indiqué 2.0 dans mes paramètres et l’installation est très récente, donc nous sommes probablement à jour.

I’ve added a setting that allows you to set a seperate time limit for undoing votes: qa undo vote action window

  • If this setting is not set, the plugin will use the core undo time limit setting for all post actions as a fallback.

  • If it is set to 0, the user will always be able to change their vote.

This change is now live on my sandbox, where I’ve set the vote undo setting to 0:

This is quite possible to do, but as I’m trying to not do any new work on this plugin I have to draw the line somewhere I’m afraid.

I’m not done forever, but I won’t be doing serious work on it for a while (i.e. months). I will fix existing functionality if it breaks however.

I don’t take paid gigs (at the moment), but if you do decide you want to fund further development of this plugin, there are some good plugin authors here on meta that could handle it. You could post it in the marketplace.

5 « J'aime »

Wow, thank you, Angus! I like how in a growing discussion people can change their vote for the best answer so the posts bumped to the top are an even better concensus of what people want. I am not sure why we were barred from changing our vote hours after voting, but I’ll be sure to set the setting to zero.

Forgive me for my obtuseness, but do we download an update to get this setting?

P.S. I tried the sandbox. Can’t wait to try it in our forum. Thanks again.

2 « J'aime »

No worries. To upgrade a plugin go to yoursite.com/admin/upgrade and click “Upgrade To the Latest Version” next to the plugin you want to upgrade (i.e. the Question Answer Plugin).

2 « J'aime »

Merci, Angus. Communiteq (anciennement DiscourseHosting) a effectué la mise à niveau. Tout fonctionne à merveille. Je suis vraiment ravi.

2 « J'aime »