Menu logo

Thoughts on Software Engineering

Open Questions Plugin for Question2Answer Q&A Platform

I use the Questions2Answer Q&A platform (Q2A) for Telerik Software Academy forums. It is great discussion board implemented in the “stackoverflow” style: questions with answers and comments, tags and categories, voting and gamification with a score system and a leaderboard.

One feature missing in Q2A is displaying the open unanswered questions. There is a similar feature called “Unanswered Questions” but it is useless because it shows the closed questions without answer. This is strange. Once a question is closed, this means its answer has been found by its author or the question is found to be duplicate or spam or irrelevant to the forum and should never be answered. Most Q&A users agree that all closed questions should be considered answered and not shown as “waiting an answer”.

Fixing the “Unanswered” Page in Q2A

The easiest way to fix the “Unanswered” questions page to exclude the closed questions is to change the line



$bysql='acount=0 AND closedbyid IS NULL';

in the function “qa_db_unanswered_qs_selectspec” located in the file “qa-include/qa-db-selects.php”.

This ugly approach works but if you upgrade the Q2A software with a newer version, the fix will be lost. A better approach is to use a plug-in. It is not hard to write a plugin for Q2A platform because it is well written, structured and even documented and uses standard PHP and MySQL programming techniques and best practices.

Open Questions Plugin for Question2Answer

I created an open-source project in GitHub to host the “Open Questions” plugin for Q2A: The plugin consists of 3 PHP files and it is relatively easy to understand how it works. The installation is trivial.

If you want to install it, just download the archive and extract it into the “qa-plugin” directory of your Q2A installation and enable it through the Admin panel:

Q2A plugin "Open Questions" by Svetlin Nakov - Installation

Q2A plugin "Open Questions" by Svetlin Nakov - Screenshot

Comments (2)

2 Responses to “Open Questions Plugin for Question2Answer Q&A Platform”

  1. says:

    This has been fixed with current version v1.6.3. Now we do not need a plugin anymore for such a basic functionality. 🙂

RSS feed for comments on this post. TrackBack URL