Skip to content

Commit 7f1aabc

Browse files
committed
ready for 0.4 release
1 parent 5096122 commit 7f1aabc

File tree

8 files changed

+82
-44
lines changed

8 files changed

+82
-44
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# Changelog
22

33

4+
## [0.4] - March 10, 2020
5+
6+
### Changed [⚠️ Breaking Changes]
7+
- `getShareScores` & `getInsights` have been decoupled from the check class, they now have to imported separately.
8+
- Minor changes in the `analyze.py` module.
9+
10+
411
## [0.3] - Jan 1, 2020
512

613
### Added

docs/changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# Changelog
22

33

4+
## [0.4] - March 10, 2020
5+
6+
### Changed [⚠️ Breaking Changes]
7+
- `getShareScores` & `getInsights` have been decoupled from the check class, they now have to imported separately.
8+
- Minor changes in the `analyze.py` module.
9+
10+
411
## [0.3] - Jan 1, 2020
512

613
### Added

docs/insights.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,24 @@
22

33
PlagCheck provides algorithmic analysis of Moss results.
44

5+
### Terminologies
56

6-
## M-group
7+
### 1. Node
8+
Nodes are results returned by Moss i.e every
9+
individual file.
10+
11+
### 2. Tags
12+
Tags are roles which a file serves i.e. a tag is
13+
a potential distributor or potential culprit or
14+
both.
15+
16+
### 3. M-group
717
m-groups (moss-groups) are groups of solution which have similar code.
818
For example A student who solves a programming problem may share their
919
solution with 3 of his/her friends, that is a single m-group with 4 nodes.
1020

1121
For example if you run [demo.py](https://github.com/codeclassroom/PlagCheck/blob/master/demo.py), `insights()` will return the following data:
12-
```python
22+
```java
1323

1424
{'DCtoC Paths': [('testfiles/test_java5.java', 'testfiles/test_java2.java'),
1525
('testfiles/test_java4.java', 'testfiles/test_java2.java')],
@@ -21,11 +31,11 @@ For example if you run [demo.py](https://github.com/codeclassroom/PlagCheck/blob
2131

2232
```
2333

24-
This analysis can be visulaized into following _Disconnected Directed Graph_
34+
This analysis can be visualized into following _Disconnected Directed Graph_
2535

2636
![moss results](https://drive.google.com/uc?export=view&id=1Lc8obgjihfo7EGimn300mTtqfmHK0Zem)
2737

28-
We assign Tags to every individual file which has been returned by Moss.
38+
We assign Tags to every individual Node.
2939

3040
1. D - Distributor
3141
Student(s) who distributed their

docs/installation.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,24 @@
22

33
Installing plagcheck is pretty simple, just run
44

5-
`pip install plagcheck`
5+
```bash
6+
pip install plagcheck
7+
```
68

79
Install a specific verison
810

9-
`pip install plagcheck==0.2`
11+
```bash
12+
pip install plagcheck==0.4
13+
```
1014

1115
or directly from GitHub if you cannot wait to test new features
1216

13-
`pip install git+https://github.com/codeclassroom/PlagCheck.git`
17+
```bash
18+
pip install git+https://github.com/codeclassroom/PlagCheck.git
19+
```
1420

15-
If you have already installed it and want to update
21+
If you have a old version, update it using
1622

17-
`pip install --upgrade plagcheck`
23+
```bash
24+
pip install --upgrade plagcheck
25+
```

docs/usage.md

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Usage
22

3-
plagcheck provides the following classes:
3+
plagcheck provides the following classes & methods:
44

55
### check(files, lang, user_id)
66

@@ -16,29 +16,33 @@ plagcheck provides the following classes:
1616
"""Usage example"""
1717
import os
1818
import pprint
19-
from plagcheck import plagcheck
19+
from plagcheck.plagcheck import check, insights, share_scores
2020

2121
from dotenv import load_dotenv
2222
load_dotenv()
2323

24-
language = "python"
24+
language = "java"
2525
userid = os.environ["USER_ID"]
2626

2727

28-
moss = plagcheck.check(language, userid)
28+
moss = check(language, userid)
2929

30-
moss.addFilesByWildCard("testfiles/test_python*.py")
30+
moss.addFilesByWildCard("testfiles/test_java*.java")
3131

3232
# or moss.addFile("testfiles/test_python.py")
3333

3434
moss.submit()
3535

3636
print(moss.getHomePage())
37-
pprint.pprint(moss.getResults())
38-
# print frequency of each shared solution
39-
pprint.pprint(moss.getShareScores())
37+
38+
result = moss.getResults()
39+
40+
pprint.pprint(result)
41+
4042
# print potential distributor-culprit relationships
41-
pprint.pprint(moss.getInsights())
43+
pprint.pprint(insights(result))
44+
# print frequency of each shared solution
45+
pprint.pprint(share_scores(result))
4246

4347
```
4448

@@ -72,18 +76,6 @@ c.getHomePage()
7276
```python
7377

7478
c.getResults()
75-
"""
76-
[
77-
{
78-
"file1":"filename1.py",
79-
"file2":"filename2.py",
80-
"percentage": 34,
81-
"no_of_lines_matched": 3,
82-
"lines_matched":[["2-3", "10-11"]]
83-
},
84-
....
85-
]
86-
"""
8779

8880
```
8981

@@ -162,14 +154,16 @@ program code that also appears in the base file is not counted in matches.
162154
code for an assignment. Multiple Base files are allowed.
163155
- You should use a base file if it is convenient; base files improve results, but are not usually necessary for obtaining useful information.
164156

165-
### 7. getShareScores()
166-
**Parameters** : `None` <br>
157+
<hr>
158+
159+
### share_scores()
160+
**Parameters** : `Moss Results`(returned by `getResults()`) <br>
167161
**Return Type** : `Dict` <br>
168162
**Description**: Share Score is a utility which returns frequency of every individual file.<br>
169163
**Demo**:
170164
```python
171165

172-
c.getShareScores()
166+
print(share_scores(moss_data))
173167

174168
# Will return
175169
"""
@@ -179,4 +173,15 @@ c.getShareScores()
179173
"""
180174
```
181175
Share Score is basically the frequency of each file appearing in Moss Results.
182-
i.e Higher the frequency, the more is that solution "shared" by different files.
176+
i.e Higher the frequency, the more is that solution "shared" by different files.
177+
178+
### insights()
179+
**Parameters** : `Moss Results`(returned by `getResults()`) <br>
180+
**Return Type** : `Dict` <br>
181+
**Description**: See [Insights](/insights).<br>
182+
**Demo**:
183+
```python
184+
185+
print(insights(moss_data))
186+
187+
```

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ nav:
88
- Documentation: index.md
99
- Installation: installation.md
1010
- Usage: usage.md
11-
- Insights: insights.md
11+
- PlagCheck Insights: insights.md
1212
- Moss: moss.md
1313
- Changelog: changelog.md
1414
- About: about.md

plagcheck/plagcheck_test.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Tests for the MOSS interface package for CodeClassroom"""
22
from plagcheck import analyze, plagcheck
3+
from plagcheck.plagcheck import insights, share_scores
34

45

56
def test_check():
@@ -11,15 +12,15 @@ def test_check():
1112
temp.addFile("testfiles/test_python2.py")
1213
temp.submit()
1314
results = temp.getResults()
14-
insights = temp.getInsights()
15-
share_scores = temp.getShareScores()
15+
moss_insights = insights(results)
16+
moss_share_scores = share_scores(results)
1617

17-
assert share_scores == {
18+
assert moss_share_scores == {
1819
"testfiles/test_python.py": 1,
1920
"testfiles/test_python2.py": 1,
2021
}
2122

22-
assert insights == {"DCtoC Paths": [], "DtoC Paths": [], "DtoDC Paths": []}
23+
assert moss_insights == {"DCtoC Paths": [], "DtoC Paths": [], "DtoDC Paths": []}
2324

2425
assert results == [
2526
{
@@ -48,8 +49,8 @@ def test_Mgroups():
4849
mg = analyze.Mgroups()
4950
mg.createNodes({"1", "2", "3"})
5051

51-
mg.relatesTo(45, 88, "3", "1")
52-
mg.relatesTo(46, 90, "3", "2")
52+
mg.relate(45, 88, "3", "1")
53+
mg.relate(46, 90, "3", "2")
5354

5455
mg.set_tags()
5556

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55

66
setuptools.setup(
77
name="plagcheck",
8-
version="0.3",
8+
version="0.4",
99
license="MIT",
1010
author="Bhupesh Varshney",
1111
author_email="[email protected]",
1212
description="Moss Results scraper with powerful insights & analysis",
1313
keywords="moss plagiarism analysis cheat mosspy",
1414
long_description=long_description,
1515
long_description_content_type="text/markdown",
16-
url="https://github.com/codeclassroom/PlagCheck",
16+
url="https://codeclassroom.github.io/PlagCheck/",
1717
project_urls={
18-
"Documentation": "https://github.com/codeclassroom/PlagCheck/blob/master/docs/docs.md",
18+
"Documentation": "https://plagcheck.readthedocs.io/en/latest/?badge=latest",
1919
"Source Code": "https://github.com/codeclassroom/PlagCheck",
2020
"Funding": "https://www.patreon.com/bePatron?u=18082750",
2121
"Say Thanks!": "https://github.com/codeclassroom/PlagCheck/issues/new?assignees=&labels=&template=---say-thank-you.md&title=",

0 commit comments

Comments
 (0)