There are some very motivated students who are very interested in math (in general), where the interest takes over most of their time. The problem is that they don't put enough time in the lecture they are attending, which leads to bad grades or even them failing the course (which is not fair for them and often leads to discouragement). [E.g. there was a student in a basic course about numerics who was understanding the basic concepts and who was always asking me questions about the axiom of choice. He lacked a deeper understanding in the course and did not perform very well at the exam]
How can I encourage to such students to concentrate on their (exam-related) study without discouraging them?