Before the lesson ended they had written three tests, (three individual completed activities).
But: It was exhausting. They had been writing tests since the lessons started. (one uninterrupted incomplete activity).