Skip to content

About

Zero-dependency exam psychometrics & fairness auditor: Classical Test Theory (KR-20/point-biserial/distractors), 1PL Rasch JMLE, Mantel-Haenszel DIF bias detection, and wrong-answer collusion forensics.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

item-psych

CI License: MIT Python 3.11+ Zero Dependencies

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)

Problem Solved

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.

Key Features

  • 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).

Architecture Overview

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]
Loading

See docs/architecture.md for module-level design details.

Installation

git clone https://github.com/codesphere-u/item-psych.git
cd item-psych
uv sync --extra dev

Or install in editable mode with standard pip:

pip install -e ".[dev]"

Quick Start (CLI)

item-psych exam_responses.json --reference-group urban --focal-group rural

Quick Start (Python API)

from 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.converged

Testing & Quality Gates

uv run ruff check src tests
uv run mypy src
uv run pytest -v

Security, Contributing & Roadmap

License

MIT License — see LICENSE.

Support & Contact

Open an issue on GitHub Issues or contact codesphereinnovationz@gmail.com.

About

Zero-dependency exam psychometrics & fairness auditor: Classical Test Theory (KR-20/point-biserial/distractors), 1PL Rasch JMLE, Mantel-Haenszel DIF bias detection, and wrong-answer collusion forensics.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages