The only way to fool the teacher would be to jailbreak the device. The 6s running iOS 9 is the most recent untethered jailbreak. All newer devices and iOS versions will revert back to stock kernel after reboot. That means no jailbreak features and the home button & guided access mode work normally.
So to fool the teacher you'd need:
- An iPhone 6s or earlier
- Running iOS 9 or earlier
- With an untethered jailbreak (Pangu9)
- Running a fake app that behaves just like the app
- And behaves like iOS's guided access mode
I think that's difficult enough to discourage the vast majority of cheaters. If the school really wanted to, they could hand out loaners to the students with old iOS devices. They'll need a bunch for the students with and Android devices anyway.
Yes, the teacher could do a more elaborate test sequence to verify that phones haven't been tampered with. But that requires (a) a bunch of time per student, and (b) an in-depth knowledge of technology and eye for UI details that Hacker News commentors have but schoolteachers often don't.
(Also, I'm not sure a jailbreak would really be required. On an iPhone X you could probably disable the Home-swipe gesture by setting that orientation to landscape or upside-down, drawing the UI and a fake home button right-side-up, and setting your app to "immersive mode" or whatever so the real home button auto-hides.)
Once Jailbroken, I don’t think you’d need a fake app. Just make a very simple patch that overrides whatever is preventing you from returning to the homescreen, and set up the patch to be enabled by a secret Activator action, like pressing the volume buttons in a secret sequence.