1

I saw the question object has a is_answered field.

I mentioned that there're the following cases:

  1. The is_answered field is true, and the question has an accepted answer.
  2. The is_answered field is true, and the question has an unaccepted answer
  3. The is_answered field is false, and the question has an unaccepted answer.
  4. The is_answered field is false, and the question has no answer.

I'm confused about this field, what actually does it mean?

1 Answer 1

1

Are you trying to report a bug? If so, provide specific examples, with question ID's.


The is_answered property is true when the question owner has selected one of the answers as "accepted". See Help Center > Answering on any site:

When a user receives a good answer to their question, that user has the option to "accept" an answer. Acceptance is indicated by a colored checkmark next to the answer that has been accepted by the original author of the question.

Accepting an answer is not meant to be a definitive and final statement indicating that the question has now been answered perfectly. It simply means that the author received an answer that worked for them personally. Not every user comes back to accept an answer...

This is consistent with your 4 cases. Refer to this Venn diagram:

Venn D

Only questions in the green circle will have is_answered set to true.

So of your 4 cases:

  1. is_answered is true, and question has an accepted answer.
    -- That's the green circle.

  2. is_answered is true, and question has an unaccepted answer.
    -- That's questions that are in the intersection of the purple circle and the green circle.

  3. is_answered is false, and question has an unaccepted answer.
    -- That's questions that are in the blue circle and outside the green circle.

  4. is_answered is false, and question has no answer.
    -- That's questions that are in the black circle and outside the blue circle.




"But anybody who has a shred of human decency does"...

2
  • So, how can I detect if the question has an accepted answer? Using the is_answered field seems not correct.
    – Bite
    Commented Jun 6, 2018 at 7:30
  • No, the is_answered field is exactly the right way to tell if a question has an accepted answer. Use accepted_answer_id to get the post id of that answer. Commented Jun 6, 2018 at 8:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .