from lib.irt.models.base import *

class ThreeParameterLogistic(Base):

    # contains the primary 3pl function, determining the probably of an inidividual
    # that an individual at a certain theta would get a particular question correct
    #  detailed further on page 161, equation 1 here:
    # https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5978482/pdf/10.1177_0146621615613308.pdf
    def result(self):
        a = self.model_params.a_param
        c = self.model_params.c_param
        return c + (1 - c) * (1 / (1 + self.e(-a *
                                                (self.theta - self.b_param))))