He _____ his homework for three hours before he went out to play. A. had done B. does C. will do D. is doing