Answer: 2. "Who was the first president of the United States?" the teacher asked.
Explanation: We know that quotations are used as dialogue indicators, and the ending quotation is ALWAYS supposed to be AFTER the punctuation or an exclamation, a question mark, a period, or a comma. Never capitalize the word after the spoken dialogue unless it's a proper name.
:)