First time here? Check out the FAQ!
2

Can an admin mark question as answered?

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.

Evgeny's avatar
13.2k
Evgeny
updated 2011-02-18 15:10:30 -0600
mwise's avatar
125
mwise
asked 2011-02-17 22:31:06 -0600
edit flag offensive 0 remove flag close merge delete

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's avatar mwise (2011-02-18 22:55:01 -0600) edit
add a comment see more comments

2 Answers

1

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 +']';
Evgeny's avatar
13.2k
Evgeny
updated 2011-02-19 19:42:07 -0600, answered 2011-02-19 03:13:07 -0600
edit flag offensive 0 remove flag delete link

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's avatar mwise (2011-02-19 18:50:19 -0600) edit
You are right, added another small change, seems to work then.
Evgeny's avatar Evgeny (2011-02-19 19:43:20 -0600) edit
thanks everything is now working :)
mwise's avatar mwise (2011-02-19 20:14:20 -0600) edit
add a comment see more comments
0

have these changes been made also to the Askbot latest release

viisik's avatar
161
viisik
answered 2011-02-20 13:40:09 -0600
edit flag offensive 0 remove flag delete link

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's avatar Evgeny (2011-02-20 13:58:13 -0600) edit
What is the status on this now?
mether's avatar mether (2011-07-10 02:21:26 -0600) edit
add a comment see more comments