Guides · Homework

How to set coding homework
students cannot copy.

When every student gets the same programming question, one student solves it and the class group shares it. This guide covers how to set coding homework that each student has to write for themselves, and how to check it without spending the weekend doing so.

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.

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:

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.

Try it in your own lab.

Register your school and try Quala Labs free for fourteen days, or book a forty-minute walkthrough on your own devices.