ADD simple cheat detection on question responses
- 主要语言
- Python
- 星标
- 381
- 派生
- 53
- PR 合并指标
- 30 天内没有已合并 PR
描述
```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)
```
贡献指南
评估
这个 Issue 还没有评估数据。