Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
709 views
in Q2A Core by
How can I allow only answer per question (same user as well as multiple users)? If the question is answered once by an expert it should not allow anyone else to answer it again (same expert or any other expert).

1 Answer

+2 votes
by

For the first part (same user) untick the option "Allow multiple answers per user" which is in Admin > Posting. There is also the option "Close questions with a selected answer" on the same page which is close to what you wanted.

There is no built-in way to allow only one answer (it kinda defeats the whole ethos behind Q&A sites, where other users can come along and post better answers). But it would be doable with a plugin.

Start here: http://www.question2answer.org/plugins.php

You'll want an event plugin. In your process_event function check for the 'a_post' event. Then take the answer's parentid (which is the ID of the question) and close the question. This should do it:

qa_post_set_closed($params['parentid'], true, null, 'Close reason');

by
Hi Scott

Thank you for your reply. I tried doing the above mentioned thing but it didnt work for me. I have the pluggin event logger installed. Are you talking about the same plugin or something else. Please let me know.
by
I am talking about making your own plugin.
...