public void playGame(int userid){
		
		this.result.setQuizId(this.quiz.getId());
		this.result.setUserId(userid);
		this.result.setData(null);
		
		String newline = System.getProperty("line.separator");
		
		// question number
		int $i = 1;
		int finalScore = 0;
		// show quiz question and answers
		for(QuizGame qgame:this.quizGame){
			/** VAR question Question **/
			Question question = new Question();
			question = qgame.getQuestion();
			// print question
			System.out.println("");
			System.out.println("::::::::::::::::::::::::::");
			System.out.println("::::: QUESTION "+$i+ ":::::::::");
			System.out.println("::::::::::::::::::::::::::");
			System.out.println("");
			System.out.println(question.getQuestionText());
			System.out.println("");
			/** VAR inpMan UserInputManager**/
			UserInputManager inpMan = new UserInputManager("INTIGER_PATTERT");
			inpMan.setMessage("");
			// next question number
			$i++;	
			// first answer number
			int a = 1;
			// print all available answers
			for(Answer answer:qgame.getAnswers()){
				inpMan.setOption(Integer.toString(a));
				System.out.print("Nr: "+a);
				System.out.println(" | "+answer.getText());		
				a++;
			}
			
			boolean nextQuestion 	= false;	
			
			while(!nextQuestion){
					
				int num = Integer.parseInt(inpMan.askAction())-1;
								
				try{
					Answer chosenAnsw = qgame.getAnswers().get(num);
					if(chosenAnsw.getId() == question.getAnswerId()){
						finalScore++;
						if(this.result.getData() == null){
							this.result.setData("option"+num+":"+chosenAnsw.getText()+" :true "+newline);
						}
						else{
							this.result.setData(result.getData()+"option"+num+":"+chosenAnsw.getText()+" :true "+newline);
						}
						nextQuestion = true;
					}else{
						if(this.result.getData()== null){
							this.result.setData("option"+num+":"+chosenAnsw.getText()+" :false "+newline);
						}
						else{
							this.result.setData(result.getData()+"option"+num+":"+chosenAnsw.getText()+" :false "+newline);
						}
						nextQuestion = true;
					}
				}
				catch(IndexOutOfBoundsException e){
					System.out.println("This number is wrong");
				}
								
			}
			
		}
		this.result.setScore(finalScore);
		
		// inser result to db
		UserModel userM = new UserModel();
		this.result.setId(userM.insertUserResult(this.result).getId());
		
		if(this.result.getId()>0){
			System.out.println("Your score is: "+this.result.getScore());
		}else{
			System.out.println("There was an error saving your score!");
		}
	}