单项选择题

It was ______ computer games that took the boy a lot of time that he ought to have spent on his lessons.

A.to have played
B.playing
C.played
D.having played