import nz.ac.massey.cs.deploymentpuzzlersurvey.TechnicalQuestions;
public class CSVExporter {
public static final String SEP = ",";
public static void exportResults (ResponseFilter responseFilter,QuestionFilter questionFilter ) throws Exception {
Responses responses = Responses.build().filter(responseFilter);
System.out.println("id,category,type,in short surv,answ (s),corr answ (s),answ (f),corr answ(f),answers,corr answe");
for (TechnicalQuestion q:TechnicalQuestions.QUESTIONS) {
if (questionFilter.accept(q)) {
String id = q.getId();
System.out.print(id);
System.out.print(SEP);
System.out.print(q.getCategory());
System.out.print(SEP);
System.out.print(q.getType());
System.out.print(SEP);
System.out.print(q.isInShortSurvey());
System.out.print(SEP);
responses.from(Survey.SHORT).answered(id).notDuplicated(id).printSize();
System.out.print(SEP);
responses.from(Survey.SHORT).answered(id).notDuplicated(id).answeredCorrectly(id).printSize();
System.out.print(SEP);
responses.from(Survey.FULL).answered(id).notDuplicated(id).printSize();
System.out.print(SEP);
responses.from(Survey.FULL).answered(id).notDuplicated(id).answeredCorrectly(id).printSize();
System.out.print(SEP);
responses.answered(id).printSize();
System.out.print(SEP);
responses.answered(id).notDuplicated(id).answeredCorrectly(id).printSize();
System.out.println();
}
}
}