Well there are a few ways this is possible;
1 - The parent could take away their phone before they go into school to prevent the usage of games
2 - The parent could download a screen monitoring app to make sure that their child isn't playing games in school by seeing what apps they'd recently used
3 - The parent could set screen time on certain apps so the child would not waste their time on the app during school and so the parent could see if they spent any time on an app during school when they come home