diff --git a/app/models/constraint.py b/app/models/constraint.py index 84eb1b2..2c84a60 100644 --- a/app/models/constraint.py +++ b/app/models/constraint.py @@ -5,5 +5,5 @@ from models.attribute import Attribute class Constraint(BaseModel): reference_attribute: Attribute - minimum: int - maximum: int + minimum: float + maximum: float diff --git a/app/models/item.py b/app/models/item.py index 86beb61..71bffcf 100644 --- a/app/models/item.py +++ b/app/models/item.py @@ -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 \ No newline at end of file