The MOSS interface package for CodeClassroom
-
Create virtual environment.
Linux/MacOS
virtualenv -p python3 venv && cd venv && source bin/activate
Windows (PowerShell)
py -m venv venv; .\venv\Scripts\activate;
-
Clone the repository.
git clone https://github.com/codeclassroom/PlagCheck.git
-
Install dependencies.
pip install -r requirements.txt
-
Set-up virtual environment variables.
-
Create a file named
.env
in the root directory & add the following contents.USER_ID = 'moss-user-id'
-
For
USER_ID
read instructions on Moss.
-
-
Run
demo.py
for demo.
Import the check
method from PlagCheck.
import os
import pprint
from plagcheck import plagcheck
program_files = ["testfiles/test_python.py", "testfiles/test_python3.py"]
language = "python"
userid = os.environ["USER_ID"]
url, results = plagcheck.check(program_files, language, userid)
print(url)
pprint.pprint(results)
Read Documentation.
Fetch the URL and gather following results:
-
Percentage of Code Matches
-
Number of Lines Matched
-
URL itself
-
Lines Matched*
-
Return a list of dictionaries containing:
[ { "file1":"filename1.py", "file2":"filename2.py", "percentage": 34, "no_of_lines_matched": 3, "lines_matched":[["2-3", "10-11"]] }, .... ]
๐ฅ Bhupesh Varshney
- Twitter: @bhupeshimself
- DEV: bhupesh