victorjatoba / AdapQ

Adapting Questions to the student ability
MIT License
5 stars 3 forks source link

Update examinee proficiency #18

Closed victorjatoba closed 7 years ago

victorjatoba commented 7 years ago

Update the examinee proficiency by MLE strategy.

victorjatoba commented 7 years ago
private void updateProficiency(boolean answer) {
    // TODO fill examinee with questions answered
    IrtExaminee examinee = this.user.getIrtExaminee();
    List<UserQuestionModel> userQuestionModels = this.userQuestionDAO.getUserQuestionModels();
    byte[] responses = new byte[userQuestionModels.size()];

    int i = 0;
    for (UserQuestionModel userQuestionModel : userQuestionModels) {
        responses[i++] = (userQuestionModel.getAnswer() == Boolean.TRUE) ? (byte) 1 : (byte) 0;
    }

    examinee.setResponseVector(responses);
    examinee.maximumLikelihoodEstimate(Constants.thetaMin, Constants.thetaMax);
}