I suspect this is an amateur plot summary.
Just as it is conventional (but by no means obligatory) to narrate histories and “serious” fictions in the past tense, it is conventional (but, again, not obligatory) to narrate the plots of dramas and fictions in the present tense—what John Lawler follows many grammatical authorities in calling the “historical present”.
A writer practised in this convention has no difficulty maintaining tensual consistency and writing
In the popular movie Good Will Hunting, a janitor working at MIT, one of the best universities in America, solves a complicated math problem that has been written on a board by a professor. The janitor, Will Hunting, has been studying mathematics on his own. The professor, Gerald Lambeau, realizes that Will has a very special talent. In the following scene, he explains the situation to another professor, Sean.
But students and casual writers* often stumble when called upon to narrate in the present tense. They feel a strong conventional pressure to tell a serious story in the past tense, and now and then, particularly when time relationships are not straightforwardly linear, they fail to resist this pressure and slip unconsciously into past-tense constructions.
What you see in this paragraph is just such a slip. Your author veers into past reference at was written, when he must back his story up to embrace the prior writing of the problem; remains in the past through the past perfect progressive construction you note; and does not recover until his narrative resumes its linear course with Prof. Lambeau's realization.
The answer, I fear, is simply that this is a mistake.
* Even highly educated professionals writing outside their own professional domains—look at a couple of plot summaries from this site, written by a Ph.D. in Analytical Chemistry.