The journal

7 min readThe Assessly team

Stopping AI cheating in coding exams

Locking the environment down is half the answer, and the smaller half. The defense that lasts is changing what the grade measures.

Any student with a browser can now produce a correct solution to almost any coding exam problem in under a minute. Not a plausible solution, a correct one: idiomatic, commented, passing every test case. This is not a prediction about where language models are heading. It is a description of the tools students already have open in another tab.

That fact has a blunt consequence for anyone running programming assessments: a grade computed only from whether the output is correct no longer measures the student. It measures whether the student had access to a chatbot, which is to say it measures nothing, because they all do.

Instructors searching for how to stop this usually find two categories of advice: detection tools and lockdown tools. One of these is a dead end. The other is genuinely useful but has a ceiling. The durable answer sits somewhere neither of them looks: not in how you police the exam, but in what you grade.

Detection is a dead end

AI-text detectors make a probabilistic guess about where a piece of writing came from, and code is an even harder case than prose, because correct code converges on the same idioms regardless of who wrote it. When a detector is right, it hands you a dispute rather than a grade. When it is wrong, it puts an honest student through a misconduct process on the strength of a percentage, and misconduct processes are quasi-legal: they demand evidence that survives scrutiny, which a black-box score is not. Every month the models improve, the guess gets worse. Building integrity policy on detection means building it on a foundation that erodes on a schedule you do not control.

What a locked environment actually buys you

Environment controls are different: they do not guess, they constrain and record. For a closed-book, high-stakes exam, they are worth taking seriously, and it is worth being concrete about what they do. Assessly's proctoring catalog spans thirteen modules an instructor can enable per assessment. The ones that matter most against AI assistance:

  • Fullscreen enforcement and tab counting, so leaving the exam to visit a chatbot is recorded as a fact with a timestamp
  • A sealed clipboard, so text cannot be pasted in from outside the locked session
  • Paste-event hashing and keystroke analysis, so if text does arrive by insertion rather than typing, the event is captured as evidence, not as a grader's hunch
  • One student, one device: concurrent sessions on the same account are blocked, closing the second-laptop workflow
  • Camera and audio monitoring tied to a verified identity, so the institution knows who sat the attempt and whether someone else was in the room dictating

Note what these modules produce: observations, not verdicts. A tab switch means nothing on its own and something in aggregate, and the judgment call stays with faculty, with context attached. That is a deliberate design position, covered in detail in our security documentation, and it matters here because AI-cheating cases are exactly where accusations without evidence fall apart.

The honest limit of lockdown

Now the part vendors tend to skip: none of this stops a sufficiently determined person. A phone propped outside the camera's view, a second device on another network, a person in the room beyond the microphone's reach. Environment controls raise the cost of cheating and document the attempt, and that is genuinely valuable. But an arms race against consumer AI is one you win only partially and only temporarily, because the other side upgrades for free.

There is also a category of assessment where lockdown does not apply at all. Take-home assignments, project work, anything asynchronous: you cannot seal a clipboard in a student's own home, and pretending otherwise just rewards whoever ignores the rule. If your integrity strategy is environment control and nothing else, everything outside the exam hall is already lost.

So treat lockdown as what it is: the narrow defense, for the narrow case. The broad defense has to live in the assessment itself.

Change what you grade

Here is the asymmetry worth building on. A language model can hand a student working code. It cannot hand them an understanding of that code, and understanding is the thing the grade was supposed to certify all along.

This is why every Assessly submission is scored twice. The code score comes from sandboxed execution against the instructor's test cases, public and hidden, in Python, JavaScript, Java, C++, or C. That remains the floor: a program that fails on empty input fails no matter who wrote it. The explanation score comes from the student's own written account of the solution: why this approach, what happens at the edges, what it costs, what they traded away. The AI grades that account across four dimensions (clarity, technical accuracy, depth, completeness), calibrated against explanations human graders have already scored, with written reasoning attached to every score and the instructor holding the override.

Copied code arrives without the thinking that produced it. The explanation score asks for exactly the part that did not come with the paste.

Watch what this does to the pasted-solution case. The code passes; the code score says so honestly. Then the student has to account for it in their own words, and an account of code you did not think through has a recognizable texture: it narrates lines instead of explaining decisions, claims properties the code does not have, goes silent on edge cases and trade-offs. The gap between a passing code score and an empty explanation score is visible to the instructor without any accusation of origin being made, and no misconduct board is asked to trust a detector's percentage. The rubric also deliberately rewards plain words over jargon, so the score measures the understanding, not the vocabulary that preparation money buys.

The deeper effect is on incentives. When students know half the grade is an explanation in their own words, pasting a solution stops being a shortcut, because it leaves the hard half of the work undone. Some students will respond by studying the generated code until they genuinely understand it, and it is worth being honest that this outcome is fine. A student who can explain the approach, its limits, and its trade-offs has demonstrated the thing the assessment exists to verify, which increasingly describes how professional software gets written anyway.

A practical checklist for instructors

Whatever platform you use, the same principles apply. Before your next assessment:

  • Match controls to stakes: full lockdown for the final exam, lighter or no proctoring for practice work, never one blanket setting for both
  • For closed-book exams, enable fullscreen enforcement, tab counting, and clipboard sealing at minimum, and tell students exactly what is recorded before they start
  • Prefer systems that log evidence with timestamps over systems that output suspicion scores; your misconduct process will thank you
  • Require a written explanation with every submission, and weight it heavily enough that skipping it costs a real fraction of the grade
  • Ask for decisions, not narration: why this data structure, what breaks it, what was rejected, not a line-by-line recap
  • Grade explanations for substance in plain words, so the score cannot be gamed by vocabulary
  • Announce the explanation requirement in advance; the expectation alone changes how students prepare
  • For take-home work, drop the pretense of policing tools and put the grade weight on the explanation, where outsourcing does not help

None of this is about catching students. It is about making the assessment measure something a chatbot cannot supply, so there is nothing worth catching.

The grade that survives

Universities do not just assign grades, they stand behind them, and employers price that signature. An assessment regime that can be passed by pasting produces grades that lose that value quietly, cohort by cohort. The institutions that come through this period with their credentials intact will be the ones that stopped asking "did you produce this code?" (a question that is no longer answerable) and started asking "can you account for it?" (a question that always was).

To see both scores produced on a real submission, and the proctoring evidence trail alongside them, get a demo. For how this fits an institution-wide integrity strategy, see Assessly for universities.

More from the journal

Was this page helpful?