3

how can an admin answer own question and accept it?

Basically we want to seed a bunch of questions to our askbot forum and would like to allow a couple people to answer and accept answers to questions.

Evgeny's avatar
13.2k
Evgeny
updated 2011-02-18 15:09:52 -0600
mwise's avatar
125
mwise
asked 2011-02-14 19:59:37 -0600
edit flag offensive 0 remove flag close merge delete

Comments

Hello, no this is not possible yet, but I will look into it, must be very simple. When do you need this? Thanks.
Evgeny's avatar Evgeny (2011-02-14 20:03:17 -0600) edit
we can work around it by using two accounts but it would be nice to have the feature for admins. We're getting our Q&A forum up and running over the next week or so
mwise's avatar mwise (2011-02-14 20:43:48 -0600) edit
Will try my best to get this done. If I can't do this properly by the next week - will post a hack.
Evgeny's avatar Evgeny (2011-02-14 21:01:23 -0600) edit
great thanks
mwise's avatar mwise (2011-02-15 15:50:08 -0600) edit
add a comment see more comments

5 Answers

2

well i put in a hack in __init__.py on L241:

if self == answer.get_owner() and not self.is_administrator():
mwise's avatar
125
mwise
answered 2011-02-18 00:39:45 -0600
edit flag offensive 0 remove flag delete link

Comments

Yes, you got it. Sorry I was away and had no time to even look into the source code.
Evgeny's avatar Evgeny (2011-02-18 05:17:12 -0600) edit
That's a first good pass, but I don't think accepting your own answer should accrue karma.
Benoit's avatar Benoit (2011-02-18 06:47:32 -0600) edit
ya you probably shouldn't get karma but for now I needed a hack :)
mwise's avatar mwise (2011-02-18 15:31:27 -0600) edit
add a comment see more comments
1

To get this done I am thinking of having the following settings:

  • minimum reputation to accept answer by person != original poster, with admins and mods exempt from the limit
  • minimum days to wait to allow such acceptance (can be 0)
  • enable/disable the feature

The "acceptor" does not earn reputation in such cases.

Evgeny's avatar
13.2k
Evgeny
updated 2011-02-14 21:03:16 -0600, answered 2011-02-14 21:01:51 -0600
edit flag offensive 0 remove flag delete link

Comments

sounds good, can't wait to get the hack
mwise's avatar mwise (2011-02-16 19:36:35 -0600) edit
I'm not sure I understand... the question is how to accept one's own answer to one's question, not how to let other people accept answers to one's question. I wouldn't want the latter functionality, but I think the former is important, given it is allowed on stackexchange (with limitations).
NoahY's avatar NoahY (2011-07-08 00:42:03 -0600) edit
add a comment see more comments
0

It seems to me the answer should be:

To get this done I am thinking of having the following settings:

  • minimum reputation to accept one's own answer, with admins and mods exempt from the limit
  • minimum days to wait to allow such acceptance (can be 0)
  • enable/disable the feature

The "acceptor" does not earn reputation in such cases.

Looking forward to this functionality! If I knew python, I'd dive right in. I looked at the code, but it's not quite like php or javascript which I'm more used to. Maybe with a little advice, I could take up the task.

NoahY's avatar
303
NoahY
updated 2011-07-08 00:45:22 -0600, answered 2011-07-08 00:43:37 -0600
edit flag offensive 0 remove flag delete link

Comments

Noah, I will be working on askbot full time starting next week, still in the process moving. I don't think I will be able to code until Monday - Tuesday.
Evgeny's avatar Evgeny (2011-07-08 02:26:07 -0600) edit
np... hope the code I posted below is useful.
NoahY's avatar NoahY (2011-07-08 02:59:52 -0600) edit
add a comment see more comments
0

UPDATED:

Okay, I realized Python is not that hard after all. I've implemented this on my server, along with a "minimum days to wait or minimum rep to override" function for answering one's own question (as per stackexchange) and admin exemption for both. I haven't added the ability to turn the feature off yet. I had to change the following files:

  • askbot/auth.py

  • askbot/conf/minimum_reputation.py

  • askbot/conf/vote_rules.py

  • askbot/models/__init__.py

  • askbot/skins/default/templates/faq.html


The changes create a new min_rep for selecting own answer and a new vote/flag setting for min_days to answer one's own question. It now checks whether one has enough rep to select one's own question, and whether a) one has enough rep to immediately answer one's own question or b) the min number of days has passed for new users to answer their own questions. Own questions can be answered and own answers can be selected if the requirements are met.

Also, forgot to mention, I added a check to auth.py so answering your own question shouldn't gain you rep or badges.

I've posted the new code here:

http://www.4shared.com/file/7w_PxlNR/askbot.html

Let me know if I've missed anything.

NoahY's avatar
303
NoahY
updated 2011-07-11 08:27:58 -0600, answered 2011-07-08 02:39:30 -0600
edit flag offensive 0 remove flag delete link

Comments

Ok, finally got a desk, will be looking at your edits tomorrow. Could you create a fork at github? It makes the easiest to merge the code, I will download your files this time, but for the future github is the way to go. Thanks!
Evgeny's avatar Evgeny (2011-07-11 16:05:01 -0600) edit
NoahY's avatar NoahY (2011-07-12 08:35:30 -0600) edit
I see you've added the changes on GitHub :) glad to be of some help.
NoahY's avatar NoahY (2011-07-21 06:13:06 -0600) edit
add a comment see more comments
0

i dont understand what is so confusing about administrator account -

administrators account should be like a moderator account + the rights to edit moderators accounts + the rights to add and edit all the content on the site

viisik's avatar
161
viisik
answered 2011-02-18 01:42:28 -0600
edit flag offensive 0 remove flag delete link

Comments

Well, it is mostly like you describe, but admins cannot vote for themselves, cannot vote more than once for a given post, cannot star a question more than once and similar limitations - maybe some should be relaxed. Admins are the same as moderators but they in addition can add/remove moderators and edit site settings.
Evgeny's avatar Evgeny (2011-02-18 05:15:58 -0600) edit
add a comment see more comments