Metadata-Version: 2.4
Name: mceval
Version: 1.0.0
Summary: Evaluate Multiple Choice Tests
Author-email: Max Zimmermann <zimmermannmax16@gmail.com>
License-Expression: EUPL-1.2
Project-URL: Repository, https://gitlab.com/zimmermannmax16/mceval
Keywords: education,multiple,choice,test,exam,chance,evaluation
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Education
Classifier: Programming Language :: Python :: 3.6
Classifier: Topic :: Education
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: COPYING
Requires-Dist: numpy
Requires-Dist: scikit-learn
Dynamic: license-file

# mceval

## Description
This repository provides an evaluation scheme of multiple choice tests, based on the 'Receiver Operating Characteristic 
Area Under Curve (ROC AUC)'. Since a classic evaluation of 1 point for true positives and -1 point for false positives 
results in a skewed expectation value when guessing, the ROC AUC provides a measure to accurately calculate a score for 
guessing and better/worse performances. The evaluation takes multiple parameters into account, such as number of 
questions, number of answer possibilities per question, number of true answers, and weighting of questions.
<a href="https://en.wikipedia.org/wiki/Receiver_operating_characteristic">Wikipedia</a>


## Installation

### Prerequisites
Install Python `>=3.6`

### Installation via pip
`pip install mceval`

## Usage
```commandline
from mceval import MultipleChoiceEvaluator


def classic_example():
    questions = 100
    answer_possibilities_per_q = 4
    true_answers = 200
    mc = MultipleChoiceEvaluator(questions, answer_possibilities_per_q, true_answers)

    true_positives = 100
    false_positives = 50
    score = mc.evaluate(true_positives, false_positives)
    print(f"Classic Example Score: {score}")
    grade, score = mc.grade(true_positives, false_positives)
    print(f"Classic Example Grade: {grade}")
    grade, score = mc.grade(true_positives, false_positives, grading_scheme=(0.95, 0.85, 0.75, 0.65))
    print(f"Classic Example Grade (other scheme): {grade}")


def weighted_example():
    questions = [60, 30]
    answer_possibilities_per_q = 4
    true_answers = [30, 15]
    weights = [1, 2]
    mc = MultipleChoiceEvaluator(questions, answer_possibilities_per_q, true_answers, weights=weights)

    true_positives = [10, 5]
    false_positives = [5, 6]
    score = mc.evaluate(true_positives, false_positives)
    print(f"Weighted Example Score: {score}")


def main():
    classic_example()
    weighted_example()


if __name__ == '__main__':
    main()
```

# Tests
To run the tests execute `pytest`.

# Support
Regarding issues please feel free to contact me via 
<a href="mailto:zimmermannmax16@gmail.com">zimmermannmax16@gmail.com</a>

## Contributing
Any contribution is welcome. 

## Authors and acknowledgment
Author: Max Zimmermann

## License
This project is licensed under the EUPL (see file `COPYING`).
