When “yes” and “no” are being used generically, there are no quotes. That is, when they are being used to refer to a positive or negative answer, they are not quoted. Attorneys are generally looking for a generic response and are not requiring that those words and only those words be used.
When the “yes” and “no” are mixed in with “uh-huh” and the like, they are quoted for consistency as “uh-huh” cannot be done as a generic.
…Please answer with “Yes” or “No” and not “Uh-huh” and “Huh-uh.”
They are quoted when someone is asking for clarification about whether that is the word that was said.
…Q Do you know whether he was there?
…Q “No,” you don’t know? Or “No,” he was not there?
…A “No,” I do not know.
When they are quoted in this fashion, they stand for a complete sentence and are also capped.