When I was a freshman in college the professor would live code various data structures and algorithms on the projector and ask the students to follow along. Each time he did this it was subtly unique.
It was required that you continue to use this same base code for the assignments plus your edits to complete it. This made it obvious who didn't attend the lectures and who they copied from. Assignments were graded by your peers and did not affect the final grade unless you didn't do them at all. Quizzes were not code, but proofs written in your own informal style. Tests were a mix of both proofs and code on paper with no notes or devices allowed.
I don't see how ChatGPT threatens this.