ADD simple cheat detection on question responses
- Vorherrschende Sprache
- Python
- Sterne
- 381
- Forks
- 53
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
```python
from difflib import SequenceMatcher
import json
import pandas as pd
def similar(a, b):
return SequenceMatcher(None, a, b).ratio()
a = json.load(open('./assignment-final-question-assignments.json'))
netids = list(a.keys())
first = next(a.values())
pools = list(map(lambda x: x['question']['pool'], first['questions']))
results = {_pool: [] for _pool in pools}
for netid in netids:
for question in a[netid]['questions']:
pool = question['pool']
text = question['response']['text']
row = []
for _netid in netids:
_text=None
for _q in a[netid]['questions']:
if _q['pool'] == pool:
_text = _q['response']['text']
break
ratio = similar(text, _text)
if len(text) == 0 or len(_text) == 0 or netid == _netid:
ratio = 0
row.append(ratio)
results[pool].append(row)
```
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.