CheatHit: plagiarism detection tool for programming assignments
Installation
Install Python 3.9 or higher, then run:
pip install cheathit
Usage
Running
Run CheatHit as follows:
cheathit /submission/directory
Or with parameters:
cheathit /submission/directory --path=group/student/problem/attempt --min-ngram=3 --max-ngram=10 --min-ratio=0.5 --max-clique=4
Or, if you want to save results to a file:
cheathit /submission/directory > /path/to/file
Parameters
--path
Specify the structure of the submission directory with this parameter. Use the student, group, problem, and attempt sections separated with slashes, e.g., group/group/student/problem/problem/attempt. Each subsequent section gets CheatHit one level down the directory tree; the last level must be a file containing the submission.
studentcorresponds to the set of programs submitted by an individual student;groupcorresponds to a group of students such that cheating is likely to take place within such a group (e.g., a school class);problemcorresponds to a separate task shared by the students;attemptcorresponds to a separate submission of a student.
The student section is required (i.e., there should be at least one of these in --path); the other three sections are optional. If the same section appears in --path multiple times, CheatHit will simply concatenate its values to obtain the “true” representation of the section.
The default value of --path is student, which is suitable for cases when there is a single directory with many files, one file per student.
--min-ngram
Minimum ngram size (number of consecutive tokens) to analyze across the submissions.
The default value of --min-ngram is 1.
--max-ngram
Maximum ngram size (number of consecutive tokens) to analyze across the submissions.
The default value of --max-ngram is 20.
--min-ratio
Minimum ratio of the number of tokens shared by two submissions to the number of tokens in the longer of the submissions required so that the pair is included in the report.
The default value of --min-ratio is 0.2.
--max-clique
If an ngram (a sequence of tokens) occurs in submissions of more than --max-clique students (or in submissions of students from more than --max-clique groups), it is not considered distinctive.
The default value of --max-clique is:
2if students are assigned groups (--pathincludesgroup),5otherwise.
Tokenization
CheatHit tokenizes source code into alphanumeric words (which can also contain underscores) and non-alphanumeric characters. Whitespace, semicolons, and commas are ignored. Two special markers, <START> and <END>, are added to the beginning and end of a token sequence. Hence,
CheatHit supports C++, Python v2 & v3, and _even_ VB.NET; awesome!
would be tokenized as
['<START>', 'CheatHit', 'supports', 'C', '+', '+', 'Python', 'v2', '&', 'v3', 'and', '_even_', 'VB', '.', 'NET', 'awesome', '!', '<END>']
Results
For each pair of students CheatHit will report how much code is shared between the students while adjusting for how distinctive the shared code is. See the Parameters and Tokenization sections above for an insight into what CheatHit considers distinctive.
Metadata
Release files for cheathit 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cheathit-1.0.1.tar.gz | 10.0 kB | Without provenance | Details for cheathit-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cheathit-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for cheathit-1.0.1-py3-none-any.whl |
Total release size: 20.2 kB
Release files / cheathit-1.0.1.tar.gz
| Download URL | cheathit-1.0.1.tar.gz |
|---|---|
| Size | 10.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
960483aba5ec6aae5ed7c1d23cff084931fb09db75e58cac47483506073fce78
|
|
BLAKE2b-256 checksum How to use checksums |
5b886c6707b89d5b3350e419713d8c2e057308c5537198f1218d5282da49dcf5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.13
|
Release files / cheathit-1.0.1-py3-none-any.whl
| Download URL | cheathit-1.0.1-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
223fdbbdaf551ffde864d01abcaa47beb66048c8422b391a5153736651928a20
|
|
BLAKE2b-256 checksum How to use checksums |
32b96a69a983c1c343437f9a71531147cd168f1f42fb0b542cf06a9bdd84e721
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.13
|
Security for cheathit 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.