add remaining constraints

This commit is contained in:
Jared Numrab 2021-11-21 21:52:18 -05:00
parent 63e5016307
commit 1d9b2c694c
2 changed files with 14 additions and 2 deletions

View File

@ -5,5 +5,5 @@ from models.attribute import Attribute
class Constraint(BaseModel):
reference_attribute: Attribute
minimum: int
maximum: int
minimum: float
maximum: float

View File

@ -16,3 +16,15 @@ class Item(BaseModel):
def irf(self, solver_run, theta):
return ItemResponseFunction(solver_run.irt_model).calculate(b_param=self.b_param,theta=theta)
def get_attribute(self, id, value):
for attribute in self.attributes:
if attribute.id == id and attribute.value == value:
return attribute.value
return False
def attribute_exists(self, id, value):
for attribute in self.attributes:
if attribute.id == id and attribute.value == value:
return True
return False