QuizQuestionFactory.printOutReadQuestion(q);
	public void readQuestions()	{		Document doc = null;				System.out.println("Reading question from file: "+this.filename);		File docFile = new File( this.filename );        try {            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();            DocumentBuilder db = dbf.newDocumentBuilder();            doc = db.parse(docFile);        } catch (java.io.IOException e) {            System.out.println("Can't find the file");        } catch (Exception e) {            System.out.println("Problem parsing the file.");            System.out.println(e.getMessage());            System.out.println(e.getStackTrace());        }                // Iterate over question elements    		NodeList questions = doc.getElementsByTagName("question");		    		int i=0;		    		for(i=0; i<questions.getLength(); i++)		{			Node question = questions.item(i);						int questionID = Integer.parseInt(question.getAttributes().getNamedItem("id").getNodeValue());						String questionText =  question.getAttributes().getNamedItem("text").getNodeValue();			NodeList answers = ((Element)question).getElementsByTagName("answer");						Node[] anArray = new Node[4];						for(int k=0; k<answers.getLength(); k++)			{				anArray[k]=answers.item(k);			}						this.shuffle(anArray);						int points = Integer.parseInt(question.getAttributes().getNamedItem("points").getNodeValue());						QuizQuestion q = new QuizQuestion(questionText);			q.setId(questionID);			q.setPoints(points);						Vector a = new Vector();				String[] antworten = new String[4];						//Iterate over answer elements			for(int j=0; j<anArray.length; j++)			{								boolean correct = false;				Node answer = anArray[j];				Node correctNode = answer.getAttributes().getNamedItem("correct");								if(correctNode!=null)				{					correct = Boolean.valueOf(correctNode.getNodeValue()).booleanValue();				}								String ans = answer.getFirstChild().getNodeValue();								a.add(ans);				if(correct)				{					// HACK					q.setCorrectAnswer(j+1);				}							}				q.setAnswers(a);			this.questions.add(q);		}        		System.out.println(i+" questions read from file");	}