Answer:
Your answer would be b.
Explanation:
The sentence that contains a misplaced modifier is sentence B. A misplaced modifier is a word, phrase, or clause that is separated from the word it modifies or describes. Because of this separation, sentences with misplaced modifiers often sound awkward.
Misplaced modifiers can be corrected by moving the modifier to a more sensible place in the sentence. Generally, they should be placed after the word they modify. In the sentence above, the misplaced modifier is the participle phrase yawning loudly. This participle is describing the NP Shelly, not the NP the question. Questions have no volition and therefore can't yawn. Consequently, the participle should occupy the pre-subject position in order to premodify the subject of the sentence (the one performing the action of yawning).
Revised version of the sentence: Yawning loudly, Shelly finally completed the last question. Finally, at 3 a.m.,