If the whole sentence, including the quotation, is a question or an exclamation, then the question mark or exclamation point goes outside the closing quotation mark; but if only the part inside the quotation marks is a question or exclamation, then the question mark or exclamation point goes inside the closing quotation mark.