Question Answer Plugin

:mega: This plugin is now retired in favour of the official Discourse Question Answer - plugin - Discourse Meta.

Question Answer plugin that allows you to create topics in a similar QA style used by Stack Overflow.

:page_facing_up: Get the code

:desktop_computer: See an example

:raising_hand_woman: Request a feature

:bug: Report a bug

Of note :memo:

  • Up-votes, but no down-votes (yet)

  • The first post of the topic cannot be voted on (yet). Adding this would raise some overlap with Discourse Feature Voting.

  • Subsequent posts can be up-voted. One vote per user per topic.

  • Posts are arranged, first by the number of votes they have received, then by the date they were posted.

  • Hereā€™s where this plugin fits into the array of similar plugins and features available in Discourse:

    • ā€œLikeā€ button. There is already a way of expressing support for a post in Discourse in the form of the like button. The main difference between that button and this plugin is that this plugin re-arranges the posts in the topic based on those that have been supported. This plugin may also add the ability to ā€˜down voteā€™ posts.

    • Solved Plugin. The Solved Plugin is an official Discourse plugin. It also allows you to create QA style topics, but of a different style. The Solved Plugin allows the original poster (or a staff member) to select a solution to the question in the first post. In contrast, this plugin allows each user of the forum a vote on what they think is the best answer.

    • Feature Voting Plugin. This plugin allows you to vote on topics themselves, as opposed to specific posts. There is a great discussion of the thinking behind this in the plugin topic and associated spec.

How to safely install or update when using our plugins:

Pavilionā€™s update schedule and support policy

This plugin is one of the Pavilion family of open source plugins.

Pavilion will focuses on ensuring compatibility of a core set of its plugins with Discourse Core tests-passed branch during the first 5 days of every month only.

Any bugs which arise because of an incompatibility will be addressed asap during this ā€˜supported periodā€™, preferably by the 7th day. Low severity or Beta feature bugs may not be addressed by this date, but obvious things which are ā€˜breakingā€™ a forum should be resolved.

If youā€™ve not used the plugin before, it is safer to adopt it within the support window, so add it and rebuild your site within the first five days of any month, otherwise itā€™s possible you may be introducing an incompatibility and we might not be around to help.

More about this policy here: Pavilion

74 Likes

This looks great! Canā€™t wait to test it out :slight_smile:

2 Likes

Great Plugin. Installed on my forum.

One request can we disable showing the upvotes count if the post has 0 upvotes? It does not look good to show 0.

10 Likes

If anyone has used the Solved plugin, which is the official Discourse Q&A plugin (i think), it would be helpful to know how these two plugins compare.

2 Likes

Good question! The Solved Plugin is indeed an official Discourse plugin. However it works differently from this plugin. The Solved Plugin allows the original poster (or an admin) to select a solution to the question in the first post. In contrast, this plugin allows each user of the forum a vote on what they think is the best answer. Different forums will want different kinds of Question / Answer style topics.

Iā€™ve added a brief description of similar plugins and Discourse features to the original post:

Hereā€™s where this plugin fits in to the array of similar plugins and features available in Discourse:

  • ā€œLikeā€ button. There is already a way of expressing support for a post in Discourse in the form of the like button. The main difference between that button and this plugin is that this plugin re-arranges the posts in the topic based on those that have been supported. This plugin may also add the ability to ā€˜down voteā€™ posts.
  • Solved Plugin. The Solved Plugin is an official Discourse plugin. It also allows you to create QA style topics, but of a different style. The Solved Plugin allows the original poster (or an admin) to select a solution to the question in the first post. In contrast, this plugin allows each user of the forum a vote on what they think is the best answer.
  • Feature Voting Plugin. This plugin allows you to vote on topics themselves, as opposed to specific posts. There is a great discussion of the thinking behind this in the plugin topic and associated spec.
17 Likes

2 features I think are worth exploring are

  1. Displaying total votes for a user in their profile
  2. Displaying the top voted posts in their user profile
    Iā€™ll try to rough out these features in the coming weeks.
5 Likes

Good ideas. In the same vein, perhaps a ā€˜badgeā€™ would also be appropriate, like the Helpdesk badge. Happy to work with you on each of these.

6 Likes

Can your plugin be used in combination with the Solved plugin?

2 Likes

I currently have both running in my instance. In the end, I think the upvoting mainly plays literally a positional role, moving posts up or down. In conjunction, I think both provide a Stack Overflow-type style.

9 Likes

Technically the logic doesnā€™t conflict, so yes the plugins can literally be used side by side without any issues.

The voting mechanism this plugin uses actually already exists in Discourseā€™s code, itā€™s just not visible. There is a vote action, and even logic that re-arranges the sort_order property of posts based on number of votes, already in the core Discourse code that is not currently usable in normal Discourse clients. This plugin exposes that action and logic.

The Solved Plugin, by contrast, uses post_custom_fields to store a boolean value about each post on a topic that can have an accepted answer (if post is accepted = true), and also uses topic_custom_fields to store the post id of the accepted post (if it exists).

However, there is an open question about what kind of QA system this creates (i.e. a product question). If the OP or an admin can select the solution to a question, then this mitigates the weighting of the ā€˜crowd-sourcedā€™ method of selecting the answer.

Using them together would create a system a bit like the federal election primaries here in the US. The popular vote for the partyā€™s candidate is mitigated by the votes of the ā€˜super delegatesā€™ (the OP and the Admins).

2 Likes

is it possible to use the QA button for another purpose: to filter and show topics which are QA listed below the button, as well as to use it as a composer in QA?

the same rule for wiki, rating, and discuss button.

how can one set up the funky compose like this sandbow?

and why the composer doesnā€™t let you decide about the category?

how can one have the category list space?

p.s.: Iā€™m confused if itā€™d better to write this as a new topic or here. sorry if I put it in the wrong place.

The composer on my dev site is a work in progress. It will change quite significantly soon.[quote=ā€œPad_Pors, post:14, topic:56032ā€]
how can one set up the funky compose like this sandbow?
[/quote]

Itā€™s a combination of this plugin with this plugin, but I wouldnā€™t recommend using it yet.

The discovery composer is context dependent. It assumes youā€™re using category navigation in a sidebar. The context (i.e. category when youā€™re in a discovery route) is set in a plugin like the map navigation widget.

This is a category list widget that I built for the map navigation widget to allow the user to select the category. You can also navigate by clicking on items on the map.

1 Like

Thanks for the description,

does this mean like this: if I choose Brazil as the category in the sidebar (using the map), any topic that I post will be in the Brazil category.

just like what happens currently in simple discourse, when we are in a category, and we open create topic, then the default category of the new topic is the category weā€™re in. correct?

Correct. Posting in the discovery composer I have built is entirely context dependent. Why restrict it like this? Because the use case Iā€™ve built it for ties categories to physical locations, giving them a somewhat different character to normal categories in a normal non-location-specific forum. If youā€™re specifically tying content to a location, you donā€™t really want your users to be so easily able to post new content in different locations. Someone can only be in one place at once.

*edit. If youā€™d like to discuss this further, letā€™s do so in the custom layouts plugin topic. Itā€™s a little off topic here.

1 Like

I think your plugin indeed is a key plugin for a QA-SO feels.
I would recommend you to rename your plugin tho. -QA is too general. What your plugin does is more specific : posts voting and sorting. Be clear : this is great and itā€™s complementary to other plugins you rightly cite, which together provide multiple bricks to pick as needed to get closer to a QA feels.

See also :
[1] : Plugin which turns discourse into stackoverflow

4 Likes

What would you suggest I call it? ā€œPost Voting and Sorting Pluginā€ doesnā€™t exactly roll off the tongue :slight_smile:

8 Likes

What would you suggest I call it? ā€œPost Voting and Sorting Pluginā€ doesnā€™t exactly roll off the tongue :slight_smile:

@angus, my name proposal : ā€œDiscourse Answers Votingā€. Sounds net.
The sorting function should be default but optional (can be disabled), as some Discourse.org users may cherish the chronological sorting. Limit your plugin to just that and its associated effects on the right-side elevator would fit well with other plugins, existing or likely to come.

1 Like

Hi Angus,

a suggestion regarding the composer plugin, that may be helpful:

Quora has a simple feature that is inspiring: ā€œpost toā€ in the same time that one is creating a topic:

hi Angus @angus , any update with the composer plugin?

1 Like

Hi Angus,

we used QA in our forum, but then the topics with more votes came down in the discussion! thatā€™s if a topic has more vote its position is more near the bottom of the topic list.

does it have anything to do with the Persian language?

e.g. you can see in this image that a topic with one upvote is after a topic with zero votes!