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

View File

@ -1,8 +1,24 @@
from pydantic import BaseModel
from typing import List
from helpers import irt_helper
from models.item import Item
from models.target import Target
from lib.irt.test_response_function import TestResponseFunction
class Form(BaseModel):
items: List[Item]
cut_score: float
tif_results: List[Target]
tcc_results: List[Target]
@classmethod
def create(cls, items, solver_run):
return cls(
items=items,
cut_score=TestResponseFunction(solver_run.irt_model).calculate(items, theta=solver_run.theta_cut_score),
tif_results=irt_helper.generate_tif_results(items, solver_run),
tcc_results=irt_helper.generate_tcc_results(items, solver_run)
)

View File

@ -1,5 +1,7 @@
from pydantic import BaseModel
from typing import Optional
class Target(BaseModel):
theta: float
value: float
result: Optional[float]