protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		HttpSession session = request.getSession();
		Quiz quiz = (Quiz)session.getAttribute("quiz");

		int correct = 0;

		ArrayList<Question> questions = quiz.getQuestions();
		session.setAttribute("questions", questions);

		boolean multiple = (Boolean)session.getAttribute("multiple");
		boolean practice = (Boolean)session.getAttribute("practice");
		RequestDispatcher dispatch = null;
		if (!multiple) {
			for (Question q : questions) {
				String questionID = Integer.toString(q.getQuestionID());
				Object answer = null;
				if (!q.getType().equals("multiple_choice_multiple_answer"))
					answer = request.getParameter(questionID);
				else {
					answer = getMultipleAnswers(request, q);
				}
				session.setAttribute(questionID, answer);
				if (q.isCorrect(answer)) {
					correct++;
				}
			}
			int score = correct;
			session.setAttribute("score", score);
			session.setAttribute("time_elapsed", getTimeElapsed(session));
			dispatch = request.getRequestDispatcher("feedback.jsp");
			dispatch.forward(request, response);	
		}
		else {
			Integer curr_question = (Integer)session.getAttribute("current_question");
			Question q = questions.get(curr_question);
			String questionID = Integer.toString(q.getQuestionID());
			Object answer = null;
			if (!q.getType().equals("multiple_choice_multiple_answer"))
				answer = request.getParameter(questionID);
			else {
				answer = getMultipleAnswers(request, q);
			}
			session.setAttribute(questionID, answer);
			if (q.isCorrect(answer)) {
				correct++;
			}
			session.setAttribute("score", (Integer)session.getAttribute("score") + correct);

			boolean immediate = (Boolean)session.getAttribute("immediate");
			if(curr_question + 1 >= quiz.getLength() && !(immediate && practice)) {
				session.setAttribute("time_elapsed", getTimeElapsed(session));
				dispatch = request.getRequestDispatcher("feedback.jsp");
			}
			else {
				if (immediate) {
					dispatch = request.getRequestDispatcher("immediate_feedback.jsp");
				}
				else {
					session.setAttribute("current_question", curr_question + 1);
					dispatch = request.getRequestDispatcher("take_quiz.jsp");
				}
			}
			dispatch.forward(request, response);

		}
	}