What is it called when a student tends to speak about what he knows? Sometimes, a student who has a lack of knowledge, tries to change the topic of a question so that it will be about what he knows and can speak about. Is this a known phenomenon in psychology?
Tom Boardman's suggestion in the question comments about the Law of the Instrument (&quot;if all you've got is a hammer, everything looks like a nail&quot;) seems to capture an important aspect of this, especially with respect to illustrating that it's not necessarily done out of malice.
The simplest theoretical explanation would cast this in terms of top-down processing and attention (Ward, 2008), combined with the availability heuristic (Schwarz et al., 1991). These two factors lead to a situation where whatever a student is knowledgeable about is more likely to come to mind in a discussion, and then whatever is on the student's mind is incorporated into the discussion. When the student encounters something that doesn't fit into what they know well, they might inadvertently change the subject to something that does, simply because that's what comes to mind and thus ends up being what shapes their thoughts.
References

Lawrence M. Ward (2008) Attention. Scholarpedia, 3(10):1538.
Schwarz, N., Bless, H., Strack, F., Klumpp, G., Rittenauer-Schatka, H., &amp; Simons, A. (1991). Ease of retrieval as information: Another look at the availability heuristic. Journal of Personality and Social psychology, 61(2), 195-202.