@Test
	public void testQuiz2() {
		Quiz quiz = Quiz.getQuizByQuizName("Bunny Quiz");
		User stanford = User.getUserByUsername("stanford");

		// QuizTakenRecord
		ArrayList<QuizTakenRecord> allHistory = quiz.getAllHistory();
		assertEquals(allHistory.size(), 9);
		for (int i = 0; i < allHistory.size() - 1; i++) {
			assertTrue(allHistory.get(i).timestamp.compareTo(allHistory.get(i+1).timestamp) <= 0);
		}
		
		ArrayList<QuizTakenRecord> stanfordHistory = quiz.getUserHistory(stanford);
		assertEquals(stanfordHistory.size(), 4);
		QuizSummary stanfordSummary = quiz.getQuizSummary(stanford);
		assertEquals(stanfordSummary.averageScore, 155.0/4, 1e-6);
		assertEquals(stanfordSummary.bestScore, 60, 1e-6);
		assertEquals(stanfordSummary.averageTimespan, 789.0/4*1000, 1e-6);
		assertEquals(stanfordSummary.bestTimespan, 54000, 1e-6);
		
		ArrayList<QuizTakenRecord> topRecords = quiz.getAllTopRecord();
		assertEquals(topRecords.size(), 9);
		assertEquals(topRecords.get(0).score, 60, 1e-6);
		assertEquals(topRecords.get(1).score, 50, 1e-6);
		assertEquals(topRecords.get(2).score, 40, 1e-6);
		assertEquals(topRecords.get(3).timeSpan, 40000, 1e-6);
		assertEquals(topRecords.get(4).timeSpan, 80000, 1e-6);
		assertEquals(topRecords.get(5).timeSpan, 54000, 1e-6);
		assertEquals(topRecords.get(6).timeSpan, 55000, 1e-6);
		assertEquals(topRecords.get(8).timeSpan, 20000, 1e-6);
		
		ArrayList<QuizTakenRecord> stanfordTopRecords = quiz.getUserTopRecord(stanford);
		assertEquals(stanfordTopRecords.size(), 4);
		assertEquals(stanfordTopRecords.get(0).score, 60, 1e-6);
		assertEquals(stanfordTopRecords.get(1).score, 35, 1e-6);
		assertEquals(stanfordTopRecords.get(2).score, 30, 1e-6);
		assertEquals(stanfordTopRecords.get(3).timeSpan, 55000, 1e-6);		
	}