private static Quiz getQuizFromHistory(String type) {
        int userId = Controller.getLoginUser().getId();
        List<QuizHistory> list = new ArrayList<>();
        try {
            list = QuizHistory.doQueryGetByUserID(conn, userId);
        } catch (SQLException ex) {
            Logger.getLogger(Controller.class.getName()).log(Level.SEVERE, null, ex);
        }
        QuizHistory quizHistory = null;
        for (QuizHistory q : list) {
            if (q.getType().equalsIgnoreCase(type)) {
                quizHistory = q;
                break;
            }
        }
        if (quizHistory == null) {
            return null;
        } else {
            try {
                //delete QuizHistory
                QuizHistory.doQueryDeleteByID(conn, quizHistory.getId());
            } catch (SQLException ex) {
                Logger.getLogger(Controller.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        String questionL = quizHistory.getQuestionList();
        String[] arr = questionL.split(EnumString.DELIMITER_QUIZHISTORY.getValue());
        List<Question> questionList = new ArrayList<>();
        int index = 0;
        for (int i = 0; i < arr.length; i++) {

            if (arr[i].isEmpty()) {
                break;
            }
            int questionID = Integer.parseInt(arr[i]);
            if (questionID == quizHistory.getCurrent_questionID()) {
                index = i;
            }
            try {
                Question q = Question.doQueryGetByID(conn, questionID);
                questionList.add(q);
            } catch (SQLException ex) {
                Logger.getLogger(Controller.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        Quiz quiz = new Quiz(questionList);
        quiz.setCurrentQuestionIndex(index);
        quiz.setCorrect(quizHistory.getPoint());
        quiz.setTopicID(quizHistory.getTopicID());
        return quiz;
    }