3. Only when Lily walked into the office ______ that she had left the contract at home.
A
she realized
B
has she realized
C
she has realized
D
did she realize
only修饰状语从句时句子部分倒装,再根据状语从句判断主句也应为一般过去时,故选项D符合答案。
根据上文可知本句是由only引导when Lily walked into the office,故主句倒装用did she realise。
常见倒装句型把握不准致错。