How about just fixing the tasks? Don't create so easy assignments that AI can directly fill the answer.
If your intent is to train future software developers, don't deny access to tools that would be used in real work. Instead, ask questions that require understanding instead of formatting known algorithm to a given simple question.