3 ms·
Funnily enough I actually implemented this [0] two semesters ago while working as a Teacher's Assistant for the into CS class. It worked fairly well. I basical
by gravypod 10y ago
Funnily enough I actually implemented this [0] two semesters ago while working as a Teacher's Assistant for the into CS class.
It worked fairly well. I basically took the levenshtein algorithm and mapped it directly to ASTs and used that to find the % of similar elements in the code. It worked a few times and I caught 1 or 2 groups of cheaters.
....sadly in that class you were allowed to "work together" you just had to include a note saying you did so I've got no "kill count" anymore and I'm not planning on TAing any time soon (at least not for python).
Also that code was hacked together in a weekend and that anti-cheet was done in 2-3 hr. It's not production ready by a longshot.
[0] - https://github.com/gravypod/GradeO/blob/master/libs/cheating_manager.py https://github.com/gravypod/GradeO/blob/master/libs/cheating...
- timtadh 10y agoA good general method for comparing ASTs is Tree Edit Distance. I have an implementation in python https://github.com/timtadh/zhang-shasha https://github.com/timtadh/zhang-shasha . If computing the exact distance is too slow you can use an approximate algorithm https://github.com/timtadh/pygram https://github.com/timtadh/pygram .