public static ArrayList<Achievement> updateAchievement(User user) {
		ArrayList<Achievement> records = AchievementRecord.getAchievementsByUserID(user.userID, QUIZ_TAKEN_TYPE);
		ArrayList<Achievement> newAchievements = new ArrayList<Achievement>();
		int totalTakenQuiz = QuizTakenRecord.getQuizHistoryByUserID(user.userID).size(); // TODO can be simplified using COUNT in database
		for (int i = 0; i < getAllAchievements().size(); i++) {
			Achievement achievement = getAllAchievements().get(i);
			boolean found = false;
			for (int j = 0; j < records.size(); j++) 
				if (records.get(j).name.equals(achievement.name)) {
					found = true;
					break;
				}
			if (found) continue;
			if (totalTakenQuiz >= achievement.threshold) {
				AchievementRecord record = new AchievementRecord(user, achievement);
				record.addRecordToDB();
				newAchievements.add(achievement);
			}			
		}
		return newAchievements;
	}