That tragedy distressed me so much that I used to keep indoors and go out only ______ necessity.
 
【正确答案】 D
【答案解析】 介词词组辨析。根据上下文,判断语境应为“需要的时候或万不得已的时候”,in case of“假如,万一”符合语境。故答案为D。