victorjatoba / AdapQ

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

To make method to select a mean/average level question #14

Closed victorjatoba closed 7 years ago

victorjatoba commented 7 years ago

If the system have no informatin about the responser, select a mean level question

victorjatoba commented 7 years ago
 /***
     * Search the question that have the average difficulty level.
     * 
     * @return the average question
     */
    public QuestionModel searchTheAverageQuestion() {

        QuestionModel averageQuestion = null;
        List<QuestionModel> sortedQuestions = Util.sortQuestionListFromEasierToHardest(DaoFake.getQuestions());

        if (!ValidationUtil.isNullOrEmpty(sortedQuestions)) {
            int averagePosition = sortedQuestions.size() / 2;
            averageQuestion = sortedQuestions.get(averagePosition);
        }

        return averageQuestion;
    }