added tcc and tif results to form

This commit is contained in:
Josh Burman
2021-10-30 07:15:49 +00:00
parent 3b83aad6bd
commit 5bd3eb7b90
4 changed files with 42 additions and 11 deletions

22
app/helpers/irt_helper.py Normal file
View File

@ -0,0 +1,22 @@
from lib.irt.test_response_function import TestResponseFunction
from lib.irt.test_information_function import TestInformationFunction
from models.target import Target
def generate_tif_results(items, solver_run):
targets = []
for target in solver_run.objective_function.tif_targets:
tif = TestInformationFunction(solver_run.irt_model).calculate(items, theta=target.theta)
targets.append(Target(theta=target.theta, value=target.value, result=tif))
return targets
def generate_tcc_results(items, solver_run):
targets = []
for target in solver_run.objective_function.tcc_targets:
tcc = TestResponseFunction(solver_run.irt_model).calculate(items, theta=target.theta)
targets.append(Target(theta=target.theta, value=target.value, result=tcc))
return targets