28 lines
801 B
Python
28 lines
801 B
Python
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]
|
|
status: str = 'Not Optimized'
|
|
|
|
@classmethod
|
|
def create(cls, items, solver_run, status):
|
|
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),
|
|
status=status)
|