Ask Your Question
3

how can an admin answer own question and accept it?

asked 2011-02-14 19:59:37 -0600

mwise gravatar image

updated 2011-02-18 15:09:52 -0600

Evgeny gravatar image

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.

edit retag flag offensive 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 gravatar imageEvgeny ( 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 gravatar imagemwise ( 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 gravatar imageEvgeny ( 2011-02-14 21:01:23 -0600 )edit
great thanks
mwise gravatar imagemwise ( 2011-02-15 15:50:08 -0600 )edit

5 Answers

Sort by ยป oldest newest most voted
1

answered 2011-02-14 21:01:51 -0600

Evgeny gravatar image

updated 2011-02-14 21:03:16 -0600

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.

edit flag offensive delete link more

Comments

sounds good, can't wait to get the hack
mwise gravatar imagemwise ( 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 gravatar imageNoahY ( 2011-07-08 00:42:03 -0600 )edit
2

answered 2011-02-18 00:39:45 -0600

mwise gravatar image

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

if self == answer.get_owner() and not self.is_administrator():
edit flag offensive delete link more

Comments

Yes, you got it. Sorry I was away and had no time to even look into the source code.
Evgeny gravatar imageEvgeny ( 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 gravatar imageBenoit ( 2011-02-18 06:47:32 -0600 )edit
ya you probably shouldn't get karma but for now I needed a hack :)
mwise gravatar imagemwise ( 2011-02-18 15:31:27 -0600 )edit
0

answered 2011-07-08 00:43:37 -0600

NoahY gravatar image

updated 2011-07-08 00:45:22 -0600

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.

edit flag offensive delete link more

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 gravatar imageEvgeny ( 2011-07-08 02:26:07 -0600 )edit
np... hope the code I posted below is useful.
NoahY gravatar imageNoahY ( 2011-07-08 02:59:52 -0600 )edit
0

answered 2011-07-08 02:39:30 -0600

NoahY gravatar image

updated 2011-07-11 08:27:58 -0600

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.

edit flag offensive delete link more

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 gravatar imageEvgeny ( 2011-07-11 16:05:01 -0600 )edit
NoahY gravatar imageNoahY ( 2011-07-12 08:35:30 -0600 )edit
I see you've added the changes on GitHub :) glad to be of some help.
NoahY gravatar imageNoahY ( 2011-07-21 06:13:06 -0600 )edit
0

answered 2011-02-18 01:42:28 -0600

viisik gravatar image

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

edit flag offensive delete link more

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 gravatar imageEvgeny ( 2011-02-18 05:15:58 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-02-14 19:59:37 -0600

Seen: 1,037 times

Last updated: Jul 11 '11