more better well factoredness

This commit is contained in:
Jared Numrab
2021-11-22 04:10:53 -05:00
parent f1a6b53265
commit c2d1ccb2bd
5 changed files with 55 additions and 29 deletions

View File

@ -17,14 +17,14 @@ 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):
def get_attribute(self, ref_attribute):
for attribute in self.attributes:
if attribute.id == id and attribute.value == value:
if attribute.id == ref_attribute.id and attribute.value == ref_attribute.value:
return attribute.value
return False
def attribute_exists(self, id, value):
def attribute_exists(self, ref_attribute):
for attribute in self.attributes:
if attribute.id == id and attribute.value == value:
if attribute.id == ref_attribute.id and attribute.value == ref_attribute.value:
return True
return False