Complemento de Pregunta y Respuesta

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 me gusta

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 Me gusta

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

2 Me gusta

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 Me gusta

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 Me gusta

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 me gusta

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 Me gusta

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 Me gusta

Gracias, @angus. Veo esta línea.

Y cuando hago clic en ella, la línea cambia a esto:

Y no hay ninguna opción para deshacer el voto. Es decir, esto no aparece:

Aquí están las opciones que he revisado en la configuración:

Tengo instalada la versión 0.2 por Communiteq (anteriormente DiscourseHosting).

1 me gusta

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 me gusta

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 Me gusta

¡Genial, Angus! Gracias. Eso sería genial. En mi caso, borré accidentalmente una publicación cuando intenté deshacer un voto, así que puedo imaginar que la gente vote por error y simplemente quiera deshacerlo al momento; por eso, poder deshacerlo inmediatamente sería excelente.

Vi en una publicación anterior que estabas considerando tener una configuración que permita establecer cuántos votos por tema puede realizar un miembro (perdona si malinterpreté). ¿Es eso correcto?

Tengo la impresión de que has terminado de trabajar en este plugin y estás pasando a otras cosas. De todos los plugins, este es el único al que financiaría cambios si tuviera el dinero. Es fantástico y un gran complemento al plugin WP Discourse que incrusta comentarios en blogs según los criterios que estableces. Con tu plugin, los miembros pueden opinar de manera significativa sobre qué llega a la parte superior de los comentarios.

P.D.: La función de deshacer no está funcionando para los votos realizados ayer. He enviado un mensaje a Communiteq (anteriormente DiscourseHosting) para verificar qué versión del plugin de preguntas y respuestas está instalada. En mis ajustes dice 2.0 y fue instalado muy recientemente, así que probablemente estamos actualizados.

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 Me gusta

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 Me gusta

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 Me gusta

Gracias, Angus. Communiteq (anteriormente DiscourseHosting) implementó la actualización. Funciona a la perfección. Estoy muy feliz.

2 Me gusta