Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
1.5k views
in Q2A Core by
Is there an option for this? It should be the default ordering IMO since up-voted answers indicates they are of better quality.

If not, consider this a feature request :)
by
This is now part of Q2A core.

3 Answers

–2 votes
by
The problem with this feature is that a good question with high up votes will sit at the top of the home page, and not allow the new questions that get asked to be viewed because there will be so many questions with more up votes.

I think there could be a page with "best questions" or "most popular"

See http://www.question2answer.org/qa/626/most-popular-questions-tab
by
No, I mean ordering the answers, not questions. When you look at a question the answers are just listed in the order they were given, like a forum. Better answers should be at the top, so that when someone comes to the page, it answers their question as quickly as possible without lots of reading.

I agree with what you said about questions though - newer/active questions should be on the home page, but options for seeing the most popular questions is a great idea.
+2 votes
by
You can experiment with the ordering of answers by changing the lines in qa-page-question.php which begin with the following:

$a_view['priority']= ...

Or you could add the following line after the 3-way $a_view['priority'] branch to make the ordering primarily based on the net number of +/- votes:

$a_view['priority']-=10*$a_view['netvotes_raw'];

(It's -= not += because lower values of $a_view['priority'] appear earlier, after sorting by the qa_sort_by(...) line that comes immediately after the loop.)
by
That's interesting, how are the answers ordered at the moment? Are there other factors that determine's an answer's priority, other than votes?
by
For now it's based on when the answers were posted, with the selected answer (if any) at the top.
0 votes
by
edited by

you can solve this problem within your theme. here's my sorting-solution:

function a_list_sort($a, $b) {
   if ($a == $b) {
       return 0;
   } else if ($b['selected']) {
       return 1;
   }
   return ($a['netvotes_raw'] > $b['netvotes_raw']) ? -1 : 1;
}
 
function a_list($a_list) {
  if (!empty($a_list)) {
    $this->section(@$a_list['title']);
    $this->output('...');
 
    uasort($a_list['as'],array($this, 'a_list_sort'));
 
    foreach ($a_list['as'] as $a_item)
      $this->a_list_item($a_item);
 
    $this->output('</DIV> <!-- END qa-a-list -->', '');
  }
}
 
if there is a "best answer", it shows on top.
by
This is not necessary now as it's included in Q2A by default.
...