There are 3 possibilities
1, 3 ,4
Why 1?
Yell? As there are many pupils, not just 1
Why not 2?
Yells? It is only used if like eg. " Mr Tan yells at whoever forgets to bring their homework"
Why 3?
It might be a third person thing. someone might have heard from someone, so "I heard Mr Tan yelled at someone just now", is ALSO correct. Because "I heard" might be a secondary person, not the primary person who genuinely heard it, as someone else might have heard it, and told others.
Why 4?
I heard Mr Tan yelling at someone just now, IS CORRECT too..
Anyway, have u got the answer?
This question sure is confusing...