My teacher says that it's not correct to answer the test
"How long (rain) yesterday?"
as "How long did it rain yesterday?"
She says there is only one way to do the problem with "how long" in the past tense with the Past Perfect Continuous. That is
How long had it been raining yesterday?
I think it's possible in a context where there is the point in the past which the Past perfect continuous relates to. But here without the context, I think the only right way is
How long did it rain yesterday?
How long was it raining yesterday?
would allow the possibility that it was continuing into today or was possibly continuing from the prior day.