Why coding homework gets copied
Programming homework is unusually easy to copy. The answer is a few lines of text, it can be sent in seconds, and a copied program runs just as well as an original one. Renaming a few variables is enough to make it look different at a glance.
Answer-finding tools have made this easier still. A student can paste the question into a search box or an AI chat and get working code back. Banning those tools at home does not work; designing homework that does not reward them does.
Give each student a different question
The single most effective change is to stop setting the same question for everyone. If no two students have the same question, there is nothing to share.
- Write a pool, not a question. For a topic such as strings, write ten or twenty short questions of similar difficulty: count the vowels, reverse each word, check for a palindrome.
- Deal them out. Give each student two or three from the pool so that, as far as possible, nobody shares a question with a classmate.
- Keep the allocation fixed. A student who opens a hard question should not be able to swap it for an easier one by asking again.
A pool takes longer to write the first time, but it is reusable: next year's class gets a fresh deal from the same pool.
Check the code as students write it
Homework that is only checked by the teacher, days later, invites copying because the feedback comes too late to matter. Automatic test cases change that: the student runs their program, sees which cases fail, and fixes it while the problem is still fresh.
Include hidden test cases that the student cannot see. A program written to match the examples fails them; a program that actually solves the problem passes.
Decide how much supervision a piece of homework needs
Most homework is practice and needs no supervision beyond a different question per student. A few pieces count towards marks, and for those it is reasonable to ask more:
- Switch off copy and paste for all homework. No teacher setting homework means to allow an answer pasted from a website.
- Ask for full screen for assessed homework, and treat leaving it as a reason to talk to the student, not as proof of cheating.
- If you use a camera, say so plainly to students and parents, record no audio, and delete the recordings once marking is done.
Marking without losing the weekend
Let the test cases do the first pass. Read code where the cases tell you something interesting: a program that passes everything in three lines, or one that fails only the edge cases. Give the class a short note on the mistakes most students made; it is more useful than thirty individual comments saying the same thing.