protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String name = request.getParameter("name");
		String description = request.getParameter("description");
		boolean ordered = request.getParameter("ordered") != null;
		boolean multi_page = request.getParameter("multi_page") != null;
		boolean immediateCorrection = request.getParameter("immediate_correction") != null;
		System.out.println(multi_page);
		System.out.println(request.getParameter("multi_page"));
		User user = (User) request.getSession().getAttribute("user");
		if (user == null || !user.isLoggedIn()) {
			response.sendRedirect("LoginServlet");
			return;
		}
		
		int numQuestions = Integer.parseInt(request.getParameter("num_questions"));
		ArrayList<Question> questions = new ArrayList<Question>();
		System.out.println("Num questions: " + numQuestions);
		for(int i = 0; i < numQuestions; i++) {
			int type = Integer.parseInt(request.getParameter("" + i + "_type"));
			Question currQuestion;
			switch (type) {
			case 0:
				currQuestion = parseQuestionResponseQuestion(request, i);
				break;
			case 1:
				currQuestion = parseFillInQuestion(request, i);
				break;
			case 2:
				currQuestion = parseMultipleChoiceQuestion(request, i);
				break;
			case 3:
				currQuestion = parsePictureResponseQuestion(request, i);
				break;
			default:
				currQuestion = null;
			}
			if (currQuestion != null) {
				questions.add(currQuestion);
			}
		}
		
		Quiz quiz = new Quiz(name, description, user.getID(), ordered, questions, multi_page, immediateCorrection);
		QuizFactory factory = QuizFactory.sharedInstance();
		int quizID = factory.insertQuiz(quiz);
		
		response.sendRedirect("QuizPage?id=" + quizID);
	}