This is not because of the Triwizard Tournament. This is because the exams do not occur on the last day of school. There are always more days after the exams. If there would be no classes then there would be no point of the school year continuing. Therefore, we must assume that they spend the last few days of the year learning "for its own sake", i.e. they do not get tested on it (or it is included in the next year's tests).
In Philosopher's Stone we see that there is at least a week of school after exams are completed:
Their very last exam was History of Magic. One hour of answering
questions about batty old wizards who’d invented self-stirring
cauldrons and they’d be free, free for a whole wonderful week until
their exam results came out.
While "they'd be free" might imply that there are no classes, it would be strange to continue the school year for another week if they were just twiddling their thumbs. Therefore, "they'd be free" might be referring to being free of exams and the accompanying stress.
In Chamber of Secrets we find out that the exams start (at least that year) on the first day of June:
Ten minutes into the class, Professor McGonagall told them that
their exams would start on the first of June, one week from today.
This would indicate that there are additional days after exams before school ends. In fact, the day they go into the Chamber of Secrets is three days before exams:
Mind you, she’ll go crazy when she finds out we’ve got exams in three
days’ time. She hasn’t studied. It might be kinder to leave her where
she is till they’re over.”
At the feast after they come out of the chamber we find out that exams have been canceled:
or Professor McGonagall standing up to tell them all that the exams
had been canceled as a school treat
However, we then are told about the rest of the term, implying that the school year went on for at least several days, and they have classes during this time:
The rest of the final term passed in a haze of blazing sunshine.
Hogwarts was back to normal with only a few, small differences —
Defense Against the Dark Arts classes were canceled (“but we’ve had
plenty of practice at that anyway,” Ron told a disgruntled Hermione)
and Lucius Malfoy had been sacked as a school governor.
In Prisoner of Azkaban we are told that the last day of exams is the sixth day of June, once again indicating that there is still school afterwards:
“It’s from Hagrid,” said Harry, ripping the note open. “Buckbeak’s
appeal — it’s set for the sixth.”
“That’s the day we finish our exams,” said Hermione, still looking
everywhere for her Arithmancy book.
Indeed the day after exams finish we are told:
As the end of term approached, Harry heard many different theories
about what had really happened, but none of them came close to the
truth.
"The end of term approached" implies that there was still a significant amount of time left to the school year after exams. Once again, if there were no classes school should just be let out.
In Goblet of Fire exams were completed on the day of the Third Task:
Ron and Hermione were supposed to be studying for their exams, which
would finish on the day of the third task, but they were putting most
of their efforts into helping Harry prepare.
The school year clearly continues after the Third Task, with the exception of Defense Against the Dark Arts classes due to there being no teacher.
In Order of the Phoenix we again see that the term continues on even after the exams have been completed:
The castle seemed very quiet even for a Sunday. Everybody was clearly
out in the sunny grounds, enjoying the end of their exams and the
prospect of a last few days of term unhampered by studying or
homework.
We can again assume that there were classes (otherwise what's the point of the term continuing), but we see that it was a more laid back time than the rest of the term, namely, there is no homework or studying.
We are also given a more precise figure for how long the term went on after the exams:
The week that had elapsed since he had last seen Sirius seemed to have
lasted much, much longer:
Harry had last seen Sirius at the Ministry, on the day of the last exam. The term thus continued for a week after the completion of the exams.
In Half-Blood Prince examinations were cancelled:
All lessons were suspended, all examinations postponed.
However, it is again implied that the school year would have continued after the completion of exams:
The beautiful weather seemed to mock them; Harry could imagine how it
would have been if Dumbledore had not died, and they had had this
time together at the very end of the year, Ginny’s examinations
finished, the pressure of homework lifted . . . and hour by hour, he
put off saying the thing that he knew he must say, doing what he knew
was right to do, because it was too hard to forgo his best source of
comfort.
In sum, we see that every year that Harry was at Hogwarts, the school year continued on for at least several days after the completion of exams. Thus, the quote in your question is just one example of a yearly phenomenon – the post-exam period of the term. Apparently, during this time there are classes, but it is a more relaxed state with no actual work.