Question Answer Plugin

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).

1 Like

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

2 Likes

What would you suggest I call it? “Post Voting and Sorting Plugin” doesn’t exactly roll off the tongue :slight_smile:

5 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.

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!

some minor issues with the QA plugin-test:

  • answers are not sorted based on their votes in our Persian forum. in fact they become randomly sorted after activation of QA tag. and won’t go back to the previous time-based sorting if I deactivate the tag from the topic :frowning:

  • people can vote to their own reply.

2 Likes

Hey dude, sorry for being unresponsive here. Will take a look soon.

1 Like

@angus did you manage to solve this?

On my forum this is also an issue, posts are not sorted based on their votes, this is an example:

1 Like

Ok, previously I was trying to be clever and use the existing sort_order property on posts, however it seems that that breaks down when the topic gets longer than a handful of posts. I’ve just directly overridden the sort order of topics which are in a QA enabled category. So it’ll work for topics of any length.

cc @Pad_Pors @TomekB

2 Likes

I tried to move a Q&A topic from the QA category to a different category, and all the votes and voting functionality disappeared. So I added a “question” tag to the topic, and all the votes came back on again. So the tag actually works.

The bug that I encountered is that, you can “like” any and all replies as long as you haven’t voted yet. However, if you vote first, then you can’t like anymore, you will get this error – “You are not permitted to view the requested resource”. So you should first undo your vote, then like some of the replies, then cast your precious one vote again.

Thanks for sharing :slight_smile:

@angus After installing your plugin I cannot read any private messages.

I get an error and this log message:

NoMethodError (undefined method custom_fields for nil:NilClass)
/var/www/discourse/plugins/discourse-qa/plugin.rb:66:in qa_enabled
1 Like

I have the same issue. Strangely it persists when entering discourse’s safe mode.

Found the reason: “Safe mode currently only disable the JavaScript portions of plugins”

3 Likes