B 是正确的.
在间接引语中,时间状语 yesterday 要变为 the day before .
还原一下你就明白了:
Mr.Green asked,'Lily,did you pass the exam yesterday?'