To answer your further question: I don't quite have the technical knowledge. I can only give you my own rule and you will have to see if others disagree..
My rule is: if a sentence ends with quoted speech then you should use the final punctuation only once and you should use it outside the quotation marks. For example..