irt-service/app/lib/irt/test_response_function.py

17 lines
455 B
Python

from lib.irt.item_response_function import ItemResponseFunction
# otherwise known as the Test Characteristic Curve (TCC)
class TestResponseFunction():
def __init__(self, irt_model):
self.irt_model = irt_model
self.irf = ItemResponseFunction(irt_model)
def calculate(self, items, **kwargs):
sum = 0
for item in items:
result = self.irf.calculate(b_param=item.b_param, theta=kwargs['theta'])
sum += result
return sum