That's true.
Learning depends on the approach. In such scenarios, many variables influence learning efficiency, such as the amount of study time, attendance, commitment, and personal effort. That way, those who only study quickly for the tests may even get a good grade, but they will not stick to learning in the long run.
For long-term use, it is necessary to adopt specific techniques, such as repetition and re-reading.