public synchronized void playQuiz(QuizServer quizAccess, String playerChoice,String[]playerData){
		int correctAnswer=0;
		int quizId=0;
		int score=0;
		int recordCount=0;
		Quiz quiz=null;
		String quizTitle="";
		//List<Integer> quizIdList = new ArrayList<Integer>();
		List<Result> resultList = null;
		Set<Question> questionList =null;
		Iterator<Question> questionIterator=null;
		
		try{
			resultList = quizAccess.getResultList();
			BufferedReader bufferedReader= new BufferedReader(new InputStreamReader(System.in));
			List<Question> quizQuestions =null;
			Iterator<Question> arrayListIterator =null;
			Set<Quiz> quizList=null;
			quizList = quizAccess.getQuizList();
			Iterator<Quiz> quizIterator=null;
			quizIterator= quizList.iterator();

		
			while(quizIterator.hasNext()){
				quiz =quizIterator.next();
				quizId=quiz.getQuizId();
				
				if (quizId==Integer.parseInt(playerChoice)){
					quizTitle=quiz.getQuizTitle();
					questionList=quiz.getQuestionsList();
				}
			}
		
			System.out.println("You chose: " + playerChoice + "  " + quizTitle);
			System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
			System.out.println();
			questionIterator= questionList.iterator();
		
			quizQuestions = new ArrayList<Question>();
		
			while(questionIterator.hasNext()){
				Question nextQuestion1 = questionIterator.next();
				quizQuestions.add(nextQuestion1);
			}	
			Collections.sort(quizQuestions, new QuestionSorter());
			
			arrayListIterator=quizQuestions.iterator();
	
			while(arrayListIterator.hasNext()){
				Question nextQ= (Question)arrayListIterator.next();
				
					String [] choices = nextQ.getAnswers();
					System.out.print("Question ID " + nextQ.getQuestionId());	
					System.out.println(" ~ " + nextQ.getQuestionTitle());	
					System.out.println(" ");	
					System.out.println(" ~ " + choices[0]);	
					System.out.println(" ~ " + choices[1]);	
					System.out.println(" ~ " + choices[2]);	
					System.out.println(" ~ " + choices[3]);	
					System.out.println(" ");
					
					System.out.print("Enter your answer (1, 2,3 or 4   ): ");
					
					String str = bufferedReader.readLine();
					correctAnswer= nextQ.getCorrectAnswer();
					
					if(Integer.parseInt(str)==correctAnswer){
						score++;
						System.out.print("Well done- that is correct!!");
						System.out.println();
						System.out.println();
					}
					else{
						System.out.println("uh-oh! that is incorrect I'm afraid");
						System.out.println();
					}
					
					recordCount=recordCount+1;
					
					System.out.println();
					if(arrayListIterator.hasNext()==false){
						System.out.println();
						
						System.out.println(playerData[1] + " ,That's the end of your quiz: Your result.... " + score + " out of " + recordCount);						
						Result clientQuizResult =  new ResultImpl(score, Integer.parseInt(playerData[0]),Integer.parseInt(playerChoice), quizTitle, playerData[1]);
						resultList.add(clientQuizResult);
						quizAccess.resultWriter(clientQuizResult);
					}else{
						
						System.out.println("Next question...... ");
					}
			}
		}catch(IOException ioException)	{
			
			ioException.printStackTrace();
		}
	}