Zero-dependency exam psychometrics & fairness auditor: Classical Test Theory (KR-20, corrected point-biserial, distractor & miskey detection), 1PL Rasch JMLE, Mantel-Haenszel DIF bias detection, and wrong-answer collusion forensics.
- Mission Domain: Education, Assessment & Exam Integrity
- Stack: Pure Python 3.11+ (zero runtime third-party dependencies,
mypy --strict,ruff,pytest) - Maintainer: Codesphere Innovations (U) Limited (
codesphere-u)
National exam boards, universities, and EdTech platforms need offline psychometric quality control to catch miskeyed MCQs, urban/rural or gender-biased questions (DIF), and exam-hall copying without proprietary statistical suites.
- Classical Test Theory engine (
analyze_ctt): KR-20 / Cronbach's alpha, SEM, corrected item-rest point-biserial correlations, non-functioning distractors, and miskeyed-answer alerts. - Pure-Python 1PL Rasch Joint Maximum Likelihood Estimation (
fit_rasch_1pl) producing anchored logit item difficulties, person abilities, and Infit/Outfit MNSQ fit statistics. - Mantel-Haenszel Differential Item Functioning (
mantel_haenszel_dif) with ETS A/B/C bias categories and Bonferroni-controlled wrong-answer-match collusion forensics (detect_wrong_answer_collusion).
flowchart LR
M[Raw MCQ / 0-1 Score Matrix] --> C[ctt.py<br/>KR-20, r_pb & Miskey Guard]
M --> R[rasch.py<br/>1PL JMLE Logits & Infit/Outfit]
M --> D[dif.py<br/>Mantel-Haenszel ETS A/B/C Bias]
M --> X[collusion.py<br/>Wrong-Answer Match z-Score]
See docs/architecture.md for module-level design details.
git clone https://github.com/codesphere-u/item-psych.git
cd item-psych
uv sync --extra devOr install in editable mode with standard pip:
pip install -e ".[dev]"item-psych exam_responses.json --reference-group urban --focal-group ruralfrom item_psych import analyze_ctt, fit_rasch_1pl
scores = [[1,1,1,0], [1,1,0,0], [1,0,0,0], [0,0,0,0]]
ctt = analyze_ctt(scores)
rasch = fit_rasch_1pl(scores)
assert ctt.kr20_alpha > 0.5 and rasch.convergeduv run ruff check src tests
uv run mypy src
uv run pytest -v- Security: See SECURITY.md for responsible disclosure procedures.
- Contributing: See CONTRIBUTING.md and CODE_OF_CONDUCT.md.
- Changelog & Roadmap: See CHANGELOG.md and ROADMAP.md.
MIT License — see LICENSE.
Open an issue on GitHub Issues or contact codesphereinnovationz@gmail.com.