I was taking a test and the test said that 1 is correct. I wonder why 2 is considered wrong (according to the opinion of the author). Is 2 wrong?
1 She said that the robber attacked her when she was opening the door to her apartment.
2 She said that the robber had attacked her when she was opening the door to her apartment.