It is not idiomatic "to give" a class. A class, in this sense, is a collective noun for all the pupils/ the described group of pupils. "Our class went to the zoo." There's a difference in meaning, of course. You can teach a class throughout the year, which means giving https://youtu.be/T0zWXvhEQwo?si=wNc6ihu97ShtIl7u