question mark and exclamation point with quotation marks

Whether the mark belongs to the quoted words or to the sentence around them.

If the quoted words are the question or the exclamation, put the mark inside. If the sentence around the quotation is the question or the exclamation, put the mark outside. He asked, “Is the gate shut?” Did she say “shut”?

Examples

Use She yelled, “Fire!”

Use Who shouted “fire”?

Avoid She yelled, “Fire”!

Avoid Who shouted “fire?”