This repository contains scripts for downloading submissions from CCSs following the Contest API Spec and running plagiarism detection using JPlag.
Download jplag.jar (e.g. from
https://github.com/jplag/JPlag/releases/download/v6.2.0/jplag-6.2.0-jar-with-dependencies.jar)
and save it as third_party/jplag.jar.
For each script invoke the script like this to download correct submissions and organize them in structure suitable for JPlag.
download_submissions.py <api_base_url> [team_categories...]Example:
download_submissions.py https://pc2/api/contests/nwerc24 teams
download_submissions.py https://domjudge.org/api/contests/nwerc24_online coaches guests observers
download_submissions.py https://kattis.com/api/contests/nwerc24_ffa contestantsTypical Output:
Storing submissions in submissions/pc_nwerc24
Found 80 teams matching categories: teams
Processing 548 correct submissions from matching teams...
Downloaded 548 submissions...
Successfully processed 548/548 submissions
Runs JPlag on submission directories to detect plagiarism. This will find all language/problem combinations with at least 2 submissions (across all directories).
run_jplag.py <submission_dir> [submission_dir ...]Example:
run_jplag.py submissions/localhost_nwerc24 submissions/pc2_nwerc24 submissions/domjudge.org_nwerc24_online submissions/kattis.com/nwerc24_ffaTypical Output:
Running JPlag for cpp/kruidnoten... done (4.9s)
Running JPlag for cpp/jibjob... done (5.3s)
Running JPlag for cpp/alphabeticalaristocrats... done (3.7s)
Running JPlag for cpp/evolvingetymology... done (2.6s)
Running JPlag for cpp/gluedgrid... done (2.4s)
Running JPlag for cpp/dutchdemocracy... done (3.2s)
Running JPlag for cpp/limitedlibrary... done (3.7s)
Running JPlag for cpp/mousetrap... done (3.2s)
Running JPlag for cpp/hashcollision... done (3.3s)
Running JPlag for cpp/binarysearch... done (1.9s)
Running JPlag for cpp/flowingfountain... done (3.9s)
Running JPlag for cpp/connectfive... done (3.7s)
Running JPlag for c/jibjob... done (2.1s)
Running JPlag for python3/kruidnoten... done (2.2s)
Running JPlag for python3/jibjob... done (3.5s)
Running JPlag for python3/alphabeticalaristocrats... done (2.6s)
Running JPlag for python3/evolvingetymology... done (1.6s)
Running JPlag for python3/dutchdemocracy... done (1.6s)
Running JPlag for python3/limitedlibrary... done (1.9s)
Running JPlag for python3/mousetrap... done (1.5s)
Running JPlag for python3/hashcollision... done (1.9s)
Running JPlag for python3/flowingfountain... done (1.8s)
Running JPlag for python3/connectfive... done (3.2s)
JPlag completed in 65.8s
Analyzes JPlag results and suggests which reports to investigate. Currently shows high similarity cases (adjust the threshold in the script) and suggests commands to view detailed reports.
analyze_jplag.py [<results_dir>]Example:
analyze_jplag.py jplag_results/1309ebed
analyze_jplag.py # No need to specify a directory, picks up the most recentTypical Output:
cpp/gluedgrid (3 cases):
• localhost_nwerc2024-team27-2232_G.cpp vs localhost_nwerc2024-team27-2306_G.cpp: 100.00%
• localhost_nwerc2024-team27-2306_G.cpp vs localhost_nwerc2024-team27-2416_G.cpp: 100.00%
• localhost_nwerc2024-team27-2232_G.cpp vs localhost_nwerc2024-team27-2416_G.cpp: 100.00%
View report:
java -jar /home/sitowert/jplag-test/third_party/jplag.jar jplag_results/1309ebed/cpp-gluedgrid.zip
cpp/evolvingetymology (2 cases):
• localhost_nwerc2024-team32-1259_main.cpp vs localhost_nwerc2024-team22-1382_e.cpp: 93.33%
• localhost_nwerc2024-team32-1259_main.cpp vs localhost_nwerc2024-team84-1332_E.cpp: 70.00%
View report:
java -jar /home/sitowert/jplag-test/third_party/jplag.jar jplag_results/1309ebed/cpp-evolvingetymology.zip
cpp/dutchdemocracy (1 case):
• localhost_nwerc2024-team83-1398_main.cpp vs localhost_nwerc2024-team32-1534_main.cpp: 86.67%
View report:
java -jar /home/sitowert/jplag-test/third_party/jplag.jar jplag_results/1309ebed/cpp-dutchdemocracy.zip
cpp/alphabeticalaristocrats (1 case):
• localhost_nwerc2024-team35-1153_main.cpp vs localhost_nwerc2024-team02-1169_a.cpp: 75.56%
View report:
java -jar /home/sitowert/jplag-test/third_party/jplag.jar jplag_results/1309ebed/cpp-alphabeticalaristocrats.zip
python3/evolvingetymology (4 cases):
• localhost_nwerc2024-team10-1254_e.py vs localhost_nwerc2024-team82-1154_e.py: 100.00%
• localhost_nwerc2024-team40-1161_main.py vs localhost_nwerc2024-team10-1254_e.py: 100.00%
• localhost_nwerc2024-team40-1161_main.py vs localhost_nwerc2024-team82-1154_e.py: 100.00%
• localhost_nwerc2024-team41-1390_e.py vs localhost_nwerc2024-team50-1225_e.py: 70.59%
View report:
java -jar /home/sitowert/jplag-test/third_party/jplag.jar jplag_results/1309ebed/python3-evolvingetymology.zip
python3/hashcollision (1 case):
• localhost_nwerc2024-team01-1372_h.py vs localhost_nwerc2024-team29-2103_H.py: 100.00%
View report:
java -jar /home/sitowert/jplag-test/third_party/jplag.jar jplag_results/1309ebed/python3-hashcollision.zip
c/jibjob (1 case):
• localhost_nwerc2024-team39-1868_main.c vs online_nwerc2024-team42-1231_main.c: 100.00%
View report:
java -jar /home/sitowert/jplag-test/third_party/jplag.jar jplag_results/1309ebed/c-jibjob.zip
Analysis completed in 0.0s
