Threadworms come from cat or dog shit generally don't they?
No. EmmaCate, your info is incorrect.
Op, it doesn't matter how good you are at trying to prevent them, if he isn't washing his hands at school after the toilet, & before eating, the cycle will continue.
Basically, if someone else in his class has them, goes to the toilet, doesn't wash hands & touches stuff that other pupils use, pens, scissors, etc he may well be getting the eggs off stuff in the classroom! Then eating the eggs.
Also, when you see he has them, he needs to be washed too, hands, bottom, fingernails etc. Children scratch & get the eggs under their nails, put their fingers in their mouth...and so the cycle continues.