public static void main(String []args) {
		try {
			//System.out.println(args.length);
			if (args.length < 3) {
				System.out.println("Usage: script pathToXMLTaskFile pathToLogFolder System");
				System.exit(0);
			}
			String taskFilePath = args [0];
			String logFolderPath = args [1];
			String system = args[2];
			FeedbackGenerator ex = new FeedbackGenerator();
			connection = ex.getDatabaseConnection();
			ResultSet rs = ex.getDatabaseConent();
			
			List<Task> tasks = new ArrayList<Task>();
						
			while (rs.next()) {
				//String q1 = rs.getString("q1");
				//if (!q1.contains("No restaurant found")) {
					String logFile = rs.getString("logfile");
					if (folderExists(logFolderPath,logFile)) {
						System.out.println("processing data " + logFile);
						Task t = new Task();
						int taskId = rs.getInt("taskID");
						String goal = ex.getTaskGoal(taskId,taskFilePath);
						t.setId(rs.getString("id"));
						t.setToken(rs.getString("token"));
						t.setLogfile(rs.getString("logfile"));
						t.setGoal(goal);
						
						String q1 = rs.getString("q1");
						if (q1.contains("No restaurant found"))
							t.setQ1("No");
						else
							t.setQ1("Yes");
				
						//t.setQ1(rs.getString("q1"));
						t.setQ2(rs.getString("q2"));
						t.setQ3(rs.getString("q3"));
						t.setQ4(rs.getString("q4"));
						t.setQ5(rs.getString("q5"));
						//t.setQ6(rs.getString("q6"));						
						//t.setQ7(rs.getString("q7"));						
						//t.setQ8(rs.getString("q8"));
						t.setTaskID(rs.getString("taskID"));
						
						//setAdditionalParameters(t,logFolderPath,logFile);
						
						tasks.add(t);
					}
					
				//}
				
			}
			
			for (Task task : tasks) {
				String fileContent = new String();
				fileContent = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n";
				fileContent += "<feedback>\n";
				
				//2014 (System15)
				fileContent += "<question id=\"1\" name=\"Did you manage to find a restaurant?\">" + task.getQ1() + "</question>\n";
				fileContent += "<question id=\"2\" name=\"I found all the information I was looking for.\">" + task.getQ2() + "</question>\n";
				fileContent += "<question id=\"3\" name=\"The system appeared to understand what I was saying.\">" + task.getQ3() + "</question>\n";
				fileContent += "<question id=\"4\" name=\"The information on restaurants was well-presented.\">" + task.getQ4() + "</question>\n";
				fileContent += "<question id=\"5\" name=\"The system's utterances were not repetitive.\">" + task.getQ5() + "</question>\n";
			
		
				//2013 (System1)
				/*
				fileContent += "<question id=\"1\" name=\"Did you manage to find a restaurant?\">" + task.getQ1() + "</question>\n";
				fileContent += "<question id=\"2\" name=\"The system appeared to understand what I was saying.\">" + task.getQ2() + "</question>\n";
				fileContent += "<question id=\"3\" name=\" I found all the information I was looking for.\">" + task.getQ3() + "</question>\n";
				fileContent += "<question id=\"4\" name=\" The system\'s utterances were well phrased.\">" + task.getQ4() + "</question>\n";
				fileContent += "<question id=\"5\" name=\" The system\'s utterances were natural, i.e. could have been produced by a human.\">" + task.getQ5() + "</question>\n";
				//fileContent += "<question id=\"6\" name=\" The system\'s utterances were repetitive.\">" + task.getQ6() + "</question>\n";
				//fileContent += "<question id=\"7\" name=\" The pace of the interaction was appropriate.\">" + task.getQ7() + "</question>\n";
				//fileContent += "<question id=\"8\" name=\" In this conversation, it was easy to find a restaurant.\">" + task.getQ8() + "</question>\n";
				*/
				
				fileContent += "<token>" + task.getToken() + "</token>\n";
				fileContent += "<dialogueId>" + task.getLogfile() + "</dialogueId>\n";
				fileContent += "<goal>" +task.getGoal() + "</goal>\n";
				fileContent += "<task>" +task.getTaskID() + "</task>\n";				
				fileContent += "</feedback>";

				//ex.updateSystemField (task.getId(),system);
				//ex.updateAdditionalParameters(task.getId(),task.getUserTurns(),task.getSystemTurns(),task.getLength(),task.getAvgWordsPerSystemTurn());
				
				
				File file = new File("feedback/"+task.getLogfile());
				if (!file.exists())
					if (!file.mkdir()) {
						System.out.println("Failed to create the folder " + "feedback/"+task.getLogfile() );
						System.exit(0);
					}
				PrintWriter write = new PrintWriter("feedback/"+task.getLogfile()+"/feedback.xml");
				write.print(fileContent);
				write.close();
				
			}
			
			
			
		}
		catch (java.lang.Exception ex) {
			ex.printStackTrace();
		}
		
		
	}