I mean, it's a clever solution, but as the teacher, I'd just ask ChatGPT the same questions, and if the student's answers match, fail them. You know teachers are totally going to do that, right? They've been using Internet tools to detect plagiarism for years now.