"I did my homework when I had watched tv." ??

I came across to this sentence in a grammar test and I'm confused?
I'm not quite sure what you meant to say, but this sentence is not correct anyway. "I was doing my homework while (I was) watching tv" may be the correct sentence if you intended to say that those two actions were happening simultaneously.
Two sequential actions have taken place: first I watched tv; then I did my homework.

The sentence is grammatically correct.
Teachers: We supply a list of EFL job vacancies
Oooops! Emotion: embarrassed
It is not clear yet for me.
AnonymousIt is not clear yet for me.
Well, how about:

After I had watched television, I did my homework.
Students: Are you brave enough to let our tutors analyse your pronunciation?
is "when" used that way?

I see now...thank you