Well this is one of my favorite questions. First of all, there is no compulsion on any one to learn it perfectly. It is the decree(Takdeer) decided by the creator how much knowledge you can gain. But, parents, teachers want us to gain knowledge and that is for our benefit. But, sometimes they end up teaching in the wrong way.
Muslims are considered to spread peace, love and affection among themselves by not hurting each other. So, such ill treating methods signify that the teacher loses patience and applies such harsh methods. But having patience and tolerance is one of the basic things which every Muslim should have.
By time, Indeed, mankind is in loss, Except for those who have believed and done righteous deeds and advised each other to truth and advised each other to patience. (Qur'an 103)
The student can't learn the entire Qur'an in one day. By ill treating, the teachers are developing unnecessary hatred in the hearts of young children against them. This could also have a negative impact on children. They would start to think that reading Qur'an is getting beaten from the teacher and hence would develop ways to avoid it.
Teach but with patience.
Pointing out more on individual circumstances pointed by you...
If they had not completed their homework. It's OK. Forgive them. You can get it done by talking politely too.
If they were talking instead of reciting. Teachers can avert this by diverting their attention by telling nice stories from the Qur'an and of Prophet(pbuh). Qur'an can be taught this way too.
If they were not paying attention. This happens only if the teacher doesn't seem interesting and children feel it's a burden focusing.
If they were day dreaming. Question the particular child how much he/she has covered.
If they were doing something naughty. Now this is an extreme case. If the child is found guilty of immoral behavior then the teacher can implement harsh methods to notify the immorality in their deed. Seriousness of being harsh depends on the deed. This could avert from a bigger bad deed in the future. Also, warn the child if possible with the punishment prescribed for that particular deed in the Qur'an and Hadith so that he/she may not repeat it again.
May the creator guide us all.