It's the second one because I just got doing this and it was right.
I think the answer is B. Because there is a period before the sentence: "The cookies were not eaten by the children" choice B contains the misplaced modifier. Unless that was a typo.
Hope this helps!:)