Writing Assignment Specs That Make Copying the Harder Path

We compared 2,846 submissions across four semesters and two versions of the same CS2 project. The version that shipped per-student input data, a short design log, and a reuse log produced about one third the flagged pairs of the version that shipped a single shared input file. That gap survived controlling for section size, instructor, and term.

If you want the short answer on how to make a programming assignment plagiarism-resistant: change what students can copy, not how loudly you warn them. What follows is the setup, the numbers, and the places where the numbers are weaker than they look.

How the comparison was set up

Eleven sections of CS2 plus four upper-division electives, fall 2022 through spring 2024. Each section ran one check per assignment covering peer similarity, web matches, and, starting in spring 2024, AI generation scores, all in the same report from our code plagiarism checker. We cross-checked a 400-submission sample against JPlag 5.1 and Dolos 2.4. All three tools agreed on the flagged set to within four percentage points, which is roughly the noise floor we've learned to expect from token-based and tree-based comparison.

A pair entered our review queue at 60% similarity with at least 25 matched token runs of 15 tokens or longer. That threshold is not sacred. At 50% the flagged volume roughly doubled, and nearly all of the additions were false positives from starter code we had forgotten to exclude from the corpus.

The assignment under study is a weighted graph project: build a graph from a text file, implement three traversals, write a shortest-path routine, produce a short report. Learning objectives were identical across versions. Delivery changed.

MeasureShared-input spec (fall 2022, n=612)Individualized spec (spring 2024, n=734)
Pairs flagged at 60% or higher112 (18.3%)45 (6.1%)
Median top-match score34%21%
Submissions with a web match above 40%165 (27.0%)81 (11.0%)
Submissions in the high AI bandnot measured68 (9.2%)
Cases taken to a formal hearing319

Two caveats before anyone quotes those rows in a committee meeting. The 2024 cohort arrived with ChatGPT already in their habits, so part of the drop in web matches reflects a change in where students copy from rather than whether they copy at all. And the 2022 sections used an input file that had been circulating on a course Discord since 2021, which inflates the baseline more than a clean redesign would.

Which spec changes did the work

Three changes accounted for most of the movement. None of them are surveillance.

Per-student input data

Each student gets a dataset derived from a seeded hash of their student ID and the term. The schema and file size stay identical, the weights and edge structures change. The generator is about 30 lines of Python, and it is the most effective single change we've made to assignment design in five years.

import hashlib

def dataset_seed(student_id: str, term: str) -> int:
    key = f"{student_id}:{term}:cs2-graph-project".encode()
    return int.from_bytes(hashlib.sha256(key).digest()[:4], "big")

# generate_graph(dataset_seed("901244517", "2024SP"))

What this buys is subtle. A copied solution still compiles, but it produces wrong output for everyone except the student it was copied from. In fall 2023, forty-odd pairs that would have gone to a hearing instead failed the autograder in week one. The instructor never had to open a similarity report.

A design log turned in before the code

Two pages, due 72 hours ahead of the code: the data structure choice, a diagram, a paragraph on the failure mode they expect. It carries 10% of the grade. Its real function is to make the thinking happen before the searching. Our read on a small sample is that students who write a design log are less likely to paste a solution that contradicts their own stated plan, because they spot the mismatch themselves.

A reuse log with a fixed comment format

Students may reuse code from the course notes, the textbook, or an open-source library, provided every reused block carries a comment in one agreed format. The format matters more than the permission.

/*
 * Source: https://stackoverflow.com/questions/11227809 (accessed 2024-02-11)
 * Used in: partition() below, lines 44-51
 * Changed: int[] replaced with List<Integer>, bounds check added
 * Why: reference implementation of the quickselect partition step
 */

We expected the reuse log to raise our flag count. It didn't. Flagged pairs fell, and the composition of what remained changed: fewer cases of "I didn't know that counted," more cases of a citation deliberately stripped out. That distinction is where your time belongs. Copying with a clumsy citation is a teaching problem. Copying with the citation removed is an integrity problem, and the two need different responses.

Side-by-side code comparison in Codequiry showing a 91% match between two student submissions
Side-by-side comparison: Codequiry lines up matching code between two submissions, with confirmed and false-positive review labels.

When a pair does reach you, the useful thing is not the percentage. It's seeing the two files aligned so you can tell whether the match is a shared idiom, a shared textbook example, or a shared line-by-line solution with the variables renamed. A side-by-side diff in the review workspace does that faster than any score.

Where this design breaks down

A student who rewrites from a description still passes. Similarity detection measures reuse of expression, not reuse of idea, and no assignment redesign changes that. If someone renames everything, token similarity drops but the AST shape usually holds. If they change both, you are looking at either an independent solution or a copy expensive enough that the design did its job. The cost asymmetry is the point: when copying takes longer than solving, the problem stops being interesting to the copier.

One failure worth repeating. Our seed function in fall 2023 hashed the student ID as a string and the term as a module-level constant, and a typo in that constant meant every ID ending in 0 received an identical seed. Twelve students got the same dataset for two weeks. Nobody noticed until a TA saw the same expected output in two separate help sessions. Randomization is code, and code has bugs. We now run the generator against 500 fake IDs and assert unique output before the term starts.

Group work is the other soft spot. When four students legitimately share a design, peer similarity flags all six pairs, and the review queue fills with collisions that are policy-compliant. We handle it by declaring group boundaries in the check configuration and excluding pairs inside a group, which works but requires the instructor to remember a setting nobody remembers. Add it to your pre-term checklist next to the starter-code exclusion.

Codequiry smart review queue ranking submissions by cohort outlier score, topped by a 100% match
The smart review queue: cohort outliers ranked by priority, so a TA reviews the riskiest five, not all fifty.

The AI pass we added in spring 2024

From spring 2024 every check also carried AI generation scoring through Codequiry's AI code detector. Of 734 submissions, 68 (9.2%) landed in the high band. The per-file view was more informative than the submission view: pasted-solution patterns concentrated in two or three files, while the rest of the submission looked hand-written. Submissions where every file scored similarly high were rare, and those were the ones that turned out to be wholesale paste jobs.

The result that matters for spec design: the high-band rate on the shared-input assignment was roughly double the rate on the individualized one. Not because a model writes worse code when the data differs. Because a pasted model solution fails the student's own test cases, so a student who would have pasted had to either adapt the output or submit something that didn't run.

An AI score is a queue, not evidence. The pattern across files is the signal, and the pattern inside one file rarely is.

False positives cluster in short, highly idiomatic files: a comparator, a leetcode-shaped helper, a standard CSV reader. One high score on that kind of file means nothing. Three files at 80% and the rest at 15% tells you the rest was written by hand.

Stacking the three signals is what makes them usable. A submission at 12% peer similarity, 0% web, and 88% AI is a conversation about process. One at 91% peer similarity and 20% AI is a conversation about two specific files. That difference is the main reason we consolidated onto one platform instead of running MOSS, a web lookup tool, and a separate AI checker. MOSS still works and it's free, but its output is an HTML mailer with an expiring link and it has no concept of a language model. If you're comparing options, the honest summary is in Codequiry vs MOSS.

Codequiry insights score breakdown separating peer similarity, web similarity and AI generation, with match sources
The score breakdown: peer similarity, web similarity and AI probability reported separately, with where the matches came from.

Rubric language that rewards the honest path

Rubric lines we now use, shortened:

  • Design log is consistent with the submitted code (10%). Arguments in the log that the code contradicts lose half credit here.
  • Every reused block carries a complete attribution comment. Missing or partial attribution caps the implementation section at half credit (15%).
  • Solution produces correct output on the student's assigned dataset (40%).
  • Readme explains one design decision and one thing that broke (5%).

The rubric has to name the reuse log explicitly. Students calibrate to what is graded, and if attribution isn't a line item they read the reuse policy as optional.

What we changed for fall 2024

Individualized data became the default across the CS2 sequence, not an option. The design log moved earlier in the calendar. We added the group boundary and starter exclusion settings to the pre-term checklist, and we retired the shared input file that had been circulating since 2021. We also stopped treating similarity numbers as findings in their own right and started attaching the matched-line count to every flag, because a 78% match on 12 lines and a 78% match on 400 lines are not the same event.

Our sample is one department and one course sequence. Treat the effect size as directional and the direction as the reliable part.

Questions we get from other departments

Does individualized data make grading harder?

Once. The autograder has to run against a generated expected output instead of a hardcoded answer key. Budget a week of setup the first term and a day each term after that.

Can students still copy when the data differs?

They can copy the structure, and some will. Per-student data raises the cost of copying rather than removing it, and the pairs that survive that filter are the ones actually worth an hour of your attention.

Do we need a separate AI detector?

Not if peer, web, and AI scoring run against the same submission set. Three reports per assignment is how review queues get abandoned by week six.

If you want to see what the combined report looks like before you redesign anything, you can run the peer, web, and AI passes in one check on a sample of last term's submissions.