Ask Your Question
2

Can an admin mark question as answered?

asked 2011-02-17 22:31:06 -0500

mwise gravatar image mwise
125 4 4 12

updated 2011-02-18 15:10:30 -0500

Evgeny gravatar image Evgeny flag of Chile
11009 50 84 182
http://askbot.org/

We have a lot of new users who are not familiar with askbot and are not marking the questions as answered is there a way for an admin to mark a question as answered.

delete close flag offensive retag edit

Comments

any idea where in the code I should start looking to enable this feature.. basically I need to change the js to allow the icon to be shown when the admin is looking at a question mwise ( 2011-02-18 22:55:01 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2011-02-19 03:13:07 -0500

Evgeny gravatar image Evgeny flag of Chile
11009 50 84 182
http://askbot.org/

updated 2011-02-19 19:42:07 -0500

Hello, to get it done quickly - please change these two things:

(1) - function askbot.models.user_assert_can_unaccept_best_answer in the file askbot/models/__init__.py - this assertion is used for both accepting and unaccepting the best answer.

(2) - show icon "accept answer" to admins - around line 207 in askbot/skins/default/templates/question.html by changing it from

{% if request.user == question.author %}
       <img id="answer-img-accept-{{ answer.id }} ...

to

{% if request.user == question.author or request.user.is_administrator() %}
       <img id="answer-img-accept-{{ answer.id }} ...

Properly it would require adding a couple of settings to the configuration and updating test cases and fix the rep awarding.

Edit: one more thing -

change file askbot/skins/default/media/js/post.js around line 288

var bindEvents = function(){
        // accept answers
        if(true){//edit on this line: was questionAuthorId == currentUserId){
            var acceptedButtons = 'div.'+ voteContainerId +' img[id^='+ imgIdPrefixAccept +']';
link publish delete flag offensive edit

Comments

that's a partial fix... the icon shows up and I made the edit to __init__.py but when I click on the accept icon nothing happens.. is there something I'm missing.. mwise ( 2011-02-19 18:50:19 -0500 )edit
You are right, added another small change, seems to work then. Evgeny ( 2011-02-19 19:43:20 -0500 )edit
thanks everything is now working :) mwise ( 2011-02-19 20:14:20 -0500 )edit
0

answered 2011-02-20 13:40:09 -0500

viisik gravatar image viisik
151 6 3 12

have these changes been made also to the Askbot latest release

link publish delete flag offensive edit

Comments

Not yet, need to write test cases, the changes in my quick answers are just hacks that may be unreliable and have side effects. Evgeny ( 2011-02-20 13:58:13 -0500 )edit
What is the status on this now? mether ( 2011-07-10 02:21:26 -0500 )edit

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Reliable Askbot Hosting

Create your Q&A site at askbot.com. Managed Askbot hosting at just $15/mo. Dedicated hosting, support contracts, consulting services.

create your Q&A site
30 days free trial

Question tools

Follow

subscribe to rss feed

Stats

Asked: 2011-02-17 22:31:06 -0500

Seen: 76 times

Last updated: Feb 20 '11